-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (72 loc) · 3.24 KB
/
deploy-docs.yml
File metadata and controls
82 lines (72 loc) · 3.24 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
71
72
73
74
75
76
77
78
79
80
81
82
name: Deploy API Documentation
on:
push:
branches: [main]
paths:
- 'index.html'
- 'health.html'
- 'verify_status/health.html'
- 'openapi.yaml'
- 'README.md'
- '.github/workflows/health-check.yml'
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages-deploy
- name: Copy documentation files to gh-pages
run: |
cp index.html gh-pages-deploy/
cp openapi.yaml gh-pages-deploy/
cp health.html gh-pages-deploy/ || true
cp verify_status/health.html gh-pages-deploy/ || true
- name: Create status directory
run: |
mkdir -p gh-pages-deploy/status
echo "Status directory created for health monitoring data"
- name: Generate API info page
run: |
cd gh-pages-deploy
echo '<!DOCTYPE html>' > api-info.html
echo '<html lang="en"><head>' >> api-info.html
echo '<meta charset="UTF-8">' >> api-info.html
echo '<title>HCP Engagement API - Live Status</title>' >> api-info.html
echo '<style>body{font-family:system-ui,sans-serif;max-width:800px;margin:0 auto;padding:20px;line-height:1.6}' >> api-info.html
echo '.status-card{background:#f8f9fa;border-left:4px solid #28a745;padding:16px;margin:16px 0;border-radius:4px}' >> api-info.html
echo '.api-link{background:#007bff;color:white;padding:12px 24px;text-decoration:none;border-radius:6px;display:inline-block;margin:8px 8px 8px 0}' >> api-info.html
echo '</style></head><body>' >> api-info.html
echo '<h1>HCP Engagement API</h1>' >> api-info.html
echo '<p>AI-powered medical literature analysis platform.</p>' >> api-info.html
echo '<div class="status-card"><h3>Live API</h3>' >> api-info.html
echo '<a href="https://hcp-engagement-api.onrender.com/" class="api-link">Live API</a>' >> api-info.html
echo '<a href="https://hcp-engagement-api.onrender.com/health" class="api-link">Health Check</a>' >> api-info.html
echo '<a href="https://hcp-engagement-api.onrender.com/docs" class="api-link">API Docs</a></div>' >> api-info.html
echo '<div class="status-card"><h3>Documentation</h3>' >> api-info.html
echo '<a href="./index.html" class="api-link">API Documentation</a>' >> api-info.html
echo '<a href="./health.html" class="api-link">Health Monitor</a></div>' >> api-info.html
echo '</body></html>' >> api-info.html
cd ..
- name: Commit and push to gh-pages
run: |
cd gh-pages-deploy
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git diff --quiet && git diff --staged --quiet || git commit -m "Deploy documentation from main branch"
git push origin gh-pages