Running #19
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: CICD Test for Reminiscence | |
run-name: Running | |
on: | |
push: | |
branches: | |
- main | |
- 'releases/**' | |
env: | |
AWS_REGION: ap-southeast-2 | |
AWS_S3_BUCKET: zero100bucket | |
AWS_CODE_DEPLOY_APPLICATION: Zero100_CICD | |
AWS_CODE_DEPLOY_GROUP: zero100_CICD_Group | |
jobs: | |
build-with-gradle: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: main ๋ธ๋์น๋ก ์ด๋ | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: JDK 11 ์ค์น | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'corretto' | |
- name: gradlew์ ์คํ ๊ถํ ๋ถ์ฌ | |
run: chmod +x gradlew | |
- name: ํ๋ก์ ํธ ๋น๋ | |
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 |