-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (46 loc) · 1.71 KB
/
SKT_T1_CD.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: 🚀 SKT-T1-APPLICATION-DEPLOY!
on:
push:
branches: [ 'main' ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
codedeploy-application-name: [ skt-t1-app ]
deployment-group-name: [ skt-t1-app-deploy-group ]
s3-bucket: [ skt-t1-app ]
steps:
- name: checkout
uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- name: mkdir resources folder
run: touch ./src/main/resources/application.yml
shell: bash
- name: copy yaml file
run: echo "${{ secrets.APPLICATION_YML }}" > ./src/main/resources/application.yml
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: 🐈 Gradle Build
run: ./gradlew clean build
- name: 📂 Make zip file
run: zip -r ./$GITHUB_SHA.zip .
- name: 🪣 S3 upload
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: ap-northeast-2
- name: 🚀 s3 upload
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://${{matrix.s3-bucket}}/deploy/$GITHUB_SHA.zip
- name: ☀️ CodeDeploy~!
run: aws deploy create-deployment
--application-name ${{matrix.codedeploy-application-name}}
--deployment-group-name ${{matrix.deployment-group-name}}
--s3-location bucket=${{matrix.s3-bucket}},bundleType=zip,key=deploy/$GITHUB_SHA.zip
--file-exists-behavior OVERWRITE
--region ap-northeast-2