-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (54 loc) · 1.98 KB
/
aws_dev.yml
File metadata and controls
70 lines (54 loc) · 1.98 KB
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
60
61
62
63
64
65
66
67
68
69
70
name: aws CI/CD
on:
push:
branches: [ "develop" ]
env:
S3_BUCKET_NAME: lof-dev-deploy
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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
shell : bash
- name: Build with Gradlew
run: ./gradlew clean build
shell : bash
- name: Make Directory
run: mkdir deploy
- name: Copy Jar
run: cp ./build/libs/*.jar ./deploy
- name: Copy appspec.yml
run: cp appspec.yml ./deploy
- name: Copy script
run: cp ./scripts/dev/*.sh ./deploy
- name: Make zip file
run: zip -r ./lof.zip ./deploy
shell: bash
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2
- name: upload to s3
run: aws s3 cp --region ap-northeast-2 ./lof.zip s3://$S3_BUCKET_NAME/
- name: Deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
run: |
aws deploy create-deployment --application-name lof-dev-application --deployment-group-name dev --file-exists-behavior OVERWRITE --s3-location bucket=lof-dev-deploy,bundleType=zip,key=lof.zip --region ap-northeast-2
- name: build result to slack
uses: 8398a7/action-slack@v3
with:
status: ${{job.status}}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}