Skip to content

running

running #59

Workflow file for this run

name: CICD Test
run-name: running
on:
push:
branches:
- master
env:
AWS_REGION: ap-northeast-2
AWS_S3_BUCKET: myflagbucket
AWS_CODE_DEPLOY_APPLICATION: cicd-test-CD
AWS_CODE_DEPLOY_GROUP: cicd-test-CD-group
jobs:
build-with-gradle:
runs-on: ubuntu-22.04
steps:
- name: master 브랜치로 이동
uses: actions/checkout@v3
with:
ref: master
- name: JDK 11 설치
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'corretto'
- name : git pull
run: git pull origin master
- name: Run chmod to make gradlew executable
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew clean build
- name: AWS credential 설정
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ env.AWS_REGION }}
aws-access-key-id: ${{ secrets.CICD_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.CICD_SECRET_KEY }}
- name: S3에 업로드
run: aws deploy push --application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} --ignore-hidden-files --s3-location s3://$AWS_S3_BUCKET/cicdtest/$GITHUB_SHA.zip --source .
- name: EC2에 배포
run: aws deploy create-deployment --application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name ${{ env.AWS_CODE_DEPLOY_GROUP }} --s3-location bucket=$AWS_S3_BUCKET,key=cicdtest/$GITHUB_SHA.zip,bundleType=zip