-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (44 loc) · 1.69 KB
/
deploy.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
name: Deploy
on:
push:
branches: [ "main", "feature/deploy" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{secrets.PRIVATE_TOKEN}}
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Make directory for deliver
run: mkdir deploy
- name: Build with Gradle
run: ./gradlew clean build
- name: Copy jar
run: cp ./build/libs/*.jar ./$GITHUB_SHA.jar
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2
- name: Upload to S3
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.jar s3://team3rdparty-bucket/deploy/$GITHUB_SHA.jar
- name: Deploy
run: |
aws deploy create-application --application-name ticketing || echo "Application 'ticketing' already exists, skipping creation."
aws deploy create-deployment \
--application-name ticketing \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--deployment-group-name ticketing-group \
--file-exists-behavior OVERWRITE \
--s3-location bucket=team3rdparty-bucket,bundleType=zip,key=deploy/$GITHUB_SHA.jar \
--target-instances 'tagFilters=[{Key=Name,Value=team3-ticket,Type=KEY_AND_VALUE}]'