Merge pull request #16 from sipe-team/feature/admin #9
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: Deploy to Amazon ECS | |
on: | |
push: | |
branches: [ "release/cicd","develop" ] | |
env: | |
AWS_REGION: ap-northeast-2 # set this to your preferred AWS region, e.g. us-west-1 | |
ECR_REPOSITORY: 01_conects_backoffice # set this to your Amazon ECR repository name | |
permissions: | |
contents: read | |
jobs: | |
Build: | |
name: Build by Gradle | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'oracle' | |
java-version: '21' | |
cache: 'gradle' | |
- name: Gradle 명령 실행 권한 부여 | |
run: chmod +x ./gradlew | |
shell: bash | |
- name: Gradle로 프로젝트 Build | |
run: | | |
./gradlew build -x test | |
- 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: ${{ env.AWS_REGION }} | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Build, tag, and push image to Amazon ECR | |
id: build-image | |
env: | |
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
IMAGE_TAG: ${{ github.sha }} | |
run: | | |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest . | |
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest |