-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (45 loc) · 1.51 KB
/
deploy.yaml
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
name: deploy
on:
pull_request:
branches: [dev, test/cd]
types: [closed]
jobs:
deploy:
runs-on: ubuntu-latest
if: github.event.pull_request.merged
steps:
- name: 체크아웃
uses: actions/checkout@v4
- name: JDK 11 설치
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '11'
cache: 'gradle'
- name: Gradle에 실행 권한 부여
run: chmod +x gradlew
- name: 빌드
run: ./gradlew build -x test
- name: zip 파일 생성
run: zip -r ./qtudy.zip .
shell: bash
- name: AWS credentials 설정
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.STG_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.STG_AWS_SECRET_KEY }}
aws-region: ap-northeast-2
- name: S3에 zip 파일 업로드
run: >
aws s3 cp
--region ap-northeast-2
./qtudy.zip s3://${{ secrets.STG_AWS_S3_BUCKET_NAME }}/qtudy.zip
- name: Code Deploy 통해 배포
run: >
aws deploy create-deployment
--application-name QtudyStageCodeDeploy
--deployment-group-name QtudyStageCodeDeploy-DepGrp
--file-exists-behavior OVERWRITE
--deployment-config-name CodeDeployDefault.AllAtOnce
--s3-location bucket=${{ secrets.STG_AWS_S3_BUCKET_NAME }},bundleType=zip,key=qtudy.zip
--region ap-northeast-2