forked from prgrms-be-devcourse/BE-02-Woowa
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.25 KB
/
cicd.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
name: Java CI with Maven & Upload to AWS S3
on:
push:
branches: [ "main" ]
jobs:
build_upload:
runs-on: ubuntu-latest
steps:
- name: Setting checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Set yaml file
uses: microsoft/variable-substitution@v1
with:
files: "./src/main/resources/application-db.yaml"
env:
spring.datasource.url: ${{ secrets.RDS_URL }}
spring.datasource.username: ${{ secrets.RDS_USER_NAME }}
spring.datasource.password: ${{ secrets.RDS_USER_PWD }}
- name: Build with Maven
run: mvn package -DskipTests
- name: Make zip file
run: zip -qq -r ./${{ secrets.PROJECT }}.zip .
shell: bash
- name: Setting AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.KEY }}
aws-secret-access-key: ${{ secrets.SECRETE }}
aws-region: ${{ secrets.REGION }}
- name: Upload to S3
run: aws s3 cp --region ${{ secrets.REGION }} ./${{ secrets.PROJECT }}.zip s3://${{ secrets.BUCKET }}/${{secrets.PROJECT}}.zip