Skip to content

Commit b73d2c5

Browse files
committed
feat: Simplify Swagger UI deployment workflow
1 parent b886904 commit b73d2c5

4 files changed

Lines changed: 98 additions & 225 deletions

File tree

Lines changed: 7 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,9 @@
1-
name: Generate and Deploy API Documentation
1+
# DISABLED - Use swagger-deploy.yml instead
22

3-
on:
4-
push:
5-
branches: [ main, develop ]
6-
paths:
7-
- 'src/**'
8-
- 'build.gradle'
9-
workflow_dispatch:
10-
inputs:
11-
server_url:
12-
description: 'OpenAPI JSON URL'
13-
required: false
14-
default: 'https://springboot.dev-leafresh.app/v3/api-docs'
15-
type: string
3+
# This workflow has been replaced by swagger-deploy.yml
4+
# Please use the simplified workflow instead.
165

17-
permissions:
18-
contents: write
19-
pages: write
20-
id-token: write
21-
22-
concurrency:
23-
group: "api-docs-update"
24-
cancel-in-progress: false
25-
26-
jobs:
27-
generate-and-deploy:
28-
runs-on: ubuntu-latest
29-
30-
steps:
31-
- name: Checkout Repository
32-
uses: actions/checkout@v4
33-
34-
- name: Setup Python
35-
uses: actions/setup-python@v4
36-
with:
37-
python-version: '3.x'
38-
39-
- name: Install Python dependencies
40-
run: |
41-
python -m pip install --upgrade pip
42-
pip install pyyaml requests
43-
44-
- name: Update OpenAPI from server
45-
run: |
46-
SERVER_URL="${{ inputs.server_url || 'https://springboot.dev-leafresh.app/v3/api-docs' }}"
47-
echo "🔍 Updating OpenAPI spec from: $SERVER_URL"
48-
49-
if python3 scripts/update-swagger-yaml.py "$SERVER_URL" swagger.yaml; then
50-
echo "✅ OpenAPI spec updated successfully"
51-
else
52-
echo "⚠️ Failed to fetch from server, keeping existing swagger.yaml"
53-
echo "This might be normal if the server is not running"
54-
fi
55-
56-
- name: Commit updated swagger.yaml
57-
run: |
58-
git config --local user.email "action@github.com"
59-
git config --local user.name "GitHub Action"
60-
61-
if git diff --quiet swagger.yaml; then
62-
echo "📝 No changes in swagger.yaml"
63-
else
64-
echo "📝 Changes detected in swagger.yaml"
65-
git add swagger.yaml
66-
git commit -m "docs: Update OpenAPI specification [skip ci]"
67-
git push
68-
fi
69-
70-
- name: Generate Swagger UI
71-
uses: Legion2/swagger-ui-action@v1
72-
with:
73-
output: swagger-ui
74-
spec-file: swagger.yaml
75-
76-
- name: Setup GitHub Pages
77-
uses: actions/configure-pages@v4
78-
79-
- name: Upload Pages Artifact
80-
uses: actions/upload-pages-artifact@v3
81-
with:
82-
path: './swagger-ui'
83-
84-
- name: Deploy to GitHub Pages
85-
id: deployment
86-
uses: actions/deploy-pages@v4
87-
88-
- name: Deploy Complete
89-
run: |
90-
echo "🎉 Swagger UI deployment completed!"
91-
echo "📖 Documentation URL: ${{ steps.deployment.outputs.page_url }}"
6+
# name: Generate and Deploy API Documentation (DISABLED)
7+
#
8+
# This file is kept for reference but is no longer active.
9+
# The active workflow is swagger-deploy.yml

.github/workflows/swagger-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy Swagger UI to GitHub Pages
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main, develop ]
66
paths:
77
- 'swagger.yaml'
88
- 'docs/openapi.yaml'
Lines changed: 7 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,9 @@
1-
name: Update Swagger Documentation
1+
# DISABLED - Use swagger-deploy.yml instead
22

3-
on:
4-
push:
5-
branches: [ main ]
6-
paths:
7-
- 'src/**'
8-
- 'build.gradle'
9-
workflow_dispatch:
10-
inputs:
11-
server_url:
12-
description: 'OpenAPI JSON URL'
13-
required: false
14-
default: 'https://springboot.dev-leafresh.app/v3/api-docs'
15-
type: string
3+
# This workflow has been replaced by swagger-deploy.yml
4+
# Please use the simplified workflow instead.
165

17-
permissions:
18-
contents: write
19-
pages: write
20-
id-token: write
21-
22-
concurrency:
23-
group: "swagger-update"
24-
cancel-in-progress: false
25-
26-
jobs:
27-
update-swagger:
28-
runs-on: ubuntu-latest
29-
30-
steps:
31-
- name: Checkout Repository
32-
uses: actions/checkout@v4
33-
34-
- name: Setup Python
35-
uses: actions/setup-python@v4
36-
with:
37-
python-version: '3.x'
38-
39-
- name: Install Python dependencies
40-
run: |
41-
python -m pip install --upgrade pip
42-
pip install pyyaml requests
43-
44-
- name: Update OpenAPI from server
45-
run: |
46-
SERVER_URL="${{ inputs.server_url || 'https://springboot.dev-leafresh.app/v3/api-docs' }}"
47-
echo "🔍 Updating OpenAPI spec from: $SERVER_URL"
48-
49-
if python3 scripts/update-swagger-yaml.py "$SERVER_URL" swagger.yaml; then
50-
echo "✅ OpenAPI spec updated successfully"
51-
else
52-
echo "⚠️ Failed to fetch from server, keeping existing swagger.yaml"
53-
echo "This might be normal if the server is not running"
54-
fi
55-
56-
- name: Commit updated swagger.yaml
57-
run: |
58-
git config --local user.email "action@github.com"
59-
git config --local user.name "GitHub Action"
60-
61-
if git diff --quiet swagger.yaml; then
62-
echo "📝 No changes in swagger.yaml"
63-
else
64-
echo "📝 Changes detected in swagger.yaml"
65-
git add swagger.yaml
66-
git commit -m "docs: Update OpenAPI specification [skip ci]"
67-
git push
68-
echo "✅ Updated swagger.yaml committed and pushed"
69-
fi
70-
71-
deploy-swagger-ui:
72-
needs: update-swagger
73-
runs-on: ubuntu-latest
74-
75-
steps:
76-
- name: Checkout Repository
77-
uses: actions/checkout@v4
78-
with:
79-
ref: main # 업데이트된 swagger.yaml을 가져오기 위해
80-
81-
- name: Generate Swagger UI
82-
uses: Legion2/swagger-ui-action@v1
83-
with:
84-
output: swagger-ui
85-
spec-file: swagger.yaml
86-
87-
- name: Setup GitHub Pages
88-
uses: actions/configure-pages@v4
89-
90-
- name: Upload Pages Artifact
91-
uses: actions/upload-pages-artifact@v3
92-
with:
93-
path: './swagger-ui'
94-
95-
- name: Deploy to GitHub Pages
96-
id: deployment
97-
uses: actions/deploy-pages@v4
98-
99-
- name: Deploy Complete
100-
run: |
101-
echo "🎉 Swagger UI deployment completed!"
102-
echo "📖 Documentation URL: ${{ steps.deployment.outputs.page_url }}"
6+
# name: Update Swagger Documentation (DISABLED)
7+
#
8+
# This file is kept for reference but is no longer active.
9+
# The active workflow is swagger-deploy.yml

docs/index.html

Lines changed: 83 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,89 @@
1-
<!-- Leafresh API Documentation -->
21
<!DOCTYPE html>
3-
<html lang="en">
4-
<head>
2+
<html lang="ko">
3+
<head>
54
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>Leafresh API Documentation</title>
7-
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
8-
<link rel="stylesheet" type="text/css" href="index.css" />
9-
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
10-
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
117
<style>
12-
body {
13-
margin: 0;
14-
background: #fafafa;
15-
}
8+
body {
9+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
10+
max-width: 800px;
11+
margin: 0 auto;
12+
padding: 2rem;
13+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
14+
min-height: 100vh;
15+
color: white;
16+
}
17+
.container {
18+
background: rgba(255, 255, 255, 0.1);
19+
backdrop-filter: blur(10px);
20+
border-radius: 20px;
21+
padding: 2rem;
22+
text-align: center;
23+
}
24+
h1 {
25+
font-size: 2.5rem;
26+
margin-bottom: 1rem;
27+
background: linear-gradient(45deg, #4CAF50, #8BC34A);
28+
-webkit-background-clip: text;
29+
-webkit-text-fill-color: transparent;
30+
background-clip: text;
31+
}
32+
.status {
33+
font-size: 1.2rem;
34+
margin: 2rem 0;
35+
padding: 1rem;
36+
background: rgba(76, 175, 80, 0.2);
37+
border-radius: 10px;
38+
border: 1px solid rgba(76, 175, 80, 0.3);
39+
}
40+
.link {
41+
display: inline-block;
42+
background: linear-gradient(45deg, #4CAF50, #45a049);
43+
color: white;
44+
padding: 1rem 2rem;
45+
text-decoration: none;
46+
border-radius: 50px;
47+
margin: 0.5rem;
48+
font-weight: 500;
49+
transition: transform 0.2s;
50+
}
51+
.link:hover {
52+
transform: translateY(-2px);
53+
box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
54+
}
55+
.emoji {
56+
font-size: 3rem;
57+
margin-bottom: 1rem;
58+
}
1659
</style>
17-
</head>
18-
19-
<body>
20-
<div id="swagger-ui"></div>
21-
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
22-
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
23-
<script>
24-
window.onload = function() {
25-
window.ui = SwaggerUIBundle({
26-
url: "./openapi.yaml",
27-
dom_id: '#swagger-ui',
28-
deepLinking: true,
29-
presets: [
30-
SwaggerUIBundle.presets.apis,
31-
SwaggerUIStandalonePreset
32-
],
33-
plugins: [
34-
SwaggerUIBundle.plugins.DownloadUrl
35-
],
36-
layout: "StandaloneLayout"
37-
});
38-
};
39-
</script>
40-
</body>
60+
</head>
61+
<body>
62+
<div class="container">
63+
<div class="emoji">🌱</div>
64+
<h1>Leafresh API Documentation</h1>
65+
<p>환경보호 챌린지 플랫폼 Leafresh의 API 문서</p>
66+
67+
<div class="status">
68+
<strong>✅ GitHub Pages 배포 완료!</strong><br>
69+
Swagger UI가 곧 이 위치에 자동으로 배포됩니다.
70+
</div>
71+
72+
<div>
73+
<a href="https://github.com/your-username/leafresh" class="link">
74+
📱 GitHub 저장소
75+
</a>
76+
<a href="https://leafresh.app" class="link">
77+
🌍 Leafresh 웹사이트
78+
</a>
79+
</div>
80+
81+
<div style="margin-top: 2rem; opacity: 0.8;">
82+
<small>
83+
🔄 GitHub Actions로 자동 배포 중...<br>
84+
Swagger UI는 swagger.yaml 파일이 업데이트될 때마다 자동으로 갱신됩니다.
85+
</small>
86+
</div>
87+
</div>
88+
</body>
4189
</html>

0 commit comments

Comments
 (0)