-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (53 loc) · 1.85 KB
/
ci.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
60
61
name: ci
on:
pull_request:
branches: [ "main", "develop" ]
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Build and analyze
env:
cloud.aws.credentials.accessKey: ${{ secrets.AWS_ACCESS_KEY }}
cloud.aws.credentials.secretKey: ${{ secrets.AWS_SECRET_KEY }}
cloud.aws.region.static: ap-northeast-2
S3_BUCKET: ${{ secrets.S3_BUCKET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
run: |
export SPRING_CLOUD_AWS_CREDENTIALS_ACCESSKEY=$AWS_ACCESS_KEY
export SPRING_CLOUD_AWS_CREDENTIALS_SECRETKEY=$AWS_SECRET_KEY
export SPRING_CLOUD_AWS_REGION_STATIC=$AWS_REGION
export S3_BUCKET=$S3_BUCKET
export JWT_SECRET=$JWT_SECRET
./gradlew build sonar --info
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Set up Database
run: |
# 데이터베이스 마이그레이션 실행
./gradlew flywayMigrate -i
env:
DB_URL: ${{ secrets.DB_URL }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}