Skip to content

Commit 4b2a4bf

Browse files
authored
[Feature] swagger 배포 자동화 (#296)
* refactor: java 배포판 temurin으로 변경 * feat: Swagger 사이트를 Cloudflare Pages에 배포 * refactor: PR 단계에서 테스트할 필요없는 workflow는 제외
1 parent a2be46e commit 4b2a4bf

3 files changed

Lines changed: 53 additions & 1 deletion

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Swagger 배포
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Code
13+
uses: actions/checkout@v4
14+
with:
15+
token: ${{ secrets.GIT_TOKEN }}
16+
submodules: true
17+
18+
- name: JDK 17 설치
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: 'temurin'
22+
java-version: '17'
23+
cache: 'gradle'
24+
25+
- name: Gradle 명령 실행 권한 부여
26+
run: chmod +x ./gradlew
27+
28+
- name: Gradle 종속성 캐싱
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.gradle/caches
32+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
33+
restore-keys: ${{ runner.os }}-gradle
34+
35+
- name: Gradle build
36+
run: ./gradlew build
37+
38+
- name: Swagger UI 생성
39+
uses: Legion2/swagger-ui-action@v1
40+
with:
41+
output: swagger-ui
42+
spec-file: build/api-spec/openapi3.yaml
43+
44+
- name: Cloudflare Pages에 배포
45+
uses: cloudflare/wrangler-action@v3
46+
with:
47+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
48+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
49+
command: pages deploy swagger-ui --project-name="signal-buddy-api-docs"
50+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docker-build-develop.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: JDK 17 설치
2727
uses: actions/setup-java@v4
2828
with:
29-
distribution: 'oracle'
29+
distribution: 'temurin'
3030
java-version: '17'
3131
cache: 'gradle'
3232

.github/workflows/pr-ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88

99
paths-ignore:
1010
- 'README.md'
11+
- '.github/workflows/deploy-swagger.yaml'
12+
- '.github/workflows/docker-build-develop.yaml'
1113

1214
jobs:
1315
test:

0 commit comments

Comments
 (0)