Fix : modify image name #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java CI with Gradle | |
on: | |
push: | |
branches: | |
- main | |
- feat/#99/implement-cicd(swm-296) | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
## gradlew 의 권한을 줍니다. | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
## gradle build | |
- name: Build with Gradle | |
run: ./gradlew clean build -x test | |
## AWS에 로그인 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ap-northeast-2 | |
## ECR에 로그인 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Build, tag, and push image to Amazon ECR | |
run: | | |
docker build -t be-repo . | |
docker tag be-repo 224066583965.dkr.ecr.ap-northeast-2.amazonaws.com/be-repo | |
docker push 224066583965.dkr.ecr.ap-northeast-2.amazonaws.com/be-repo |