Skip to content

Commit 8bdccc7

Browse files
authored
Workflows for CICD Test
1 parent c46a756 commit 8bdccc7

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

โ€Ž.github/workflows/gradle.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CICD Test for Reminixcence
2+
run-name: Running
3+
on:
4+
push:
5+
branches: main
6+
pull_request:
7+
branches: main
8+
9+
env:
10+
AWS_REGION: ap-southeast-2
11+
AWS_S3_BUCKET: app-release-files
12+
AWS_CODE_DEPLOY_APPLICATION: Zero100_CICD
13+
AWS_CODE_DEPLOY_GROUP: zero100_CICD_Group
14+
15+
jobs:
16+
build-with-gradle:
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- name: main ๋ธŒ๋žœ์น˜๋กœ ์ด๋™
20+
uses: actions/checkout@v3
21+
with:
22+
ref: production
23+
- name: JDK 11 ์„ค์น˜
24+
uses: actions/setup-java@v3
25+
with:
26+
java-version: '11'
27+
distribution: 'corretto'
28+
- name: gradlew์— ์‹คํ–‰ ๊ถŒํ•œ ๋ถ€์—ฌ
29+
run: chmod +x ./gradlew
30+
- name: ํ”„๋กœ์ ํŠธ ๋นŒ๋“œ
31+
run: ./gradlew clean build -x test
32+
- name: AWS credential ์„ค์ •
33+
uses: aws-actions/configure-aws-credentials@v1
34+
with:
35+
aws-region: ${{ env.AWS_REGION }}
36+
aws-access-key-id: ${{ secrets.CICD_ACCESS_KEY }}
37+
aws-secret-access-key: ${{ secrets.CICD_SECRET_KEY }}
38+
- name: S3์— ์—…๋กœ๋“œ
39+
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 .
40+
- name: EC2์— ๋ฐฐํฌ
41+
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

0 commit comments

Comments
ย (0)