-
Notifications
You must be signed in to change notification settings - Fork 3
91 lines (76 loc) · 2.34 KB
/
Copy pathdocs-deploy.yml
File metadata and controls
91 lines (76 loc) · 2.34 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
83
84
85
86
87
88
89
90
91
name: Docs Deploy
on:
push:
branches: [ master ]
paths:
- "docs/starlight/**"
- "openapi/**"
- "docker/Dockerfile.docs"
- "docker/nginx-docs.conf"
- "fly.docs.toml"
- ".github/workflows/docs-deploy.yml"
workflow_dispatch:
permissions:
contents: read
env:
NODE_VERSION: "22.13.0"
jobs:
build-and-validate:
name: Build Starlight Docs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm ci
working-directory: docs/starlight
- name: Copy OpenAPI specs
run: |
mkdir -p docs/starlight/public/openapi
cp openapi/v1/*.yaml docs/starlight/public/openapi/
- name: Build docs
run: npm run build
working-directory: docs/starlight
deploy-production:
name: Deploy Docs Production
runs-on: ubuntu-latest
needs: [build-and-validate]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
concurrency:
group: deploy-docs-production
cancel-in-progress: false
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Fly.io CLI
uses: superfly/flyctl-actions/setup-flyctl@1.6
- name: Validate Fly token
run: |
if [ -z "${FLY_API_TOKEN:-}" ]; then
echo "FLY_DOCS_API_TOKEN secret is required for docs production deployment."
exit 1
fi
flyctl auth whoami
env:
FLY_API_TOKEN: ${{ secrets.FLY_DOCS_API_TOKEN }}
- name: Deploy production docs app
run: flyctl deploy --config fly.docs.toml --app protocolsoup-docs --remote-only
timeout-minutes: 15
env:
FLY_API_TOKEN: ${{ secrets.FLY_DOCS_API_TOKEN }}
- name: Smoke test
run: |
for url in "https://protocolsoup-docs.fly.dev/" "https://docs.protocolsoup.com/"; do
for i in 1 2 3; do
if curl -fsS --retry 2 --retry-delay 5 "$url" > /dev/null 2>&1; then
echo "✓ $url"
break
fi
echo "Attempt $i failed for $url, waiting 10s..."
sleep 10
done
done