-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (50 loc) · 1.94 KB
/
Copy pathdocs-deploy.yml
File metadata and controls
59 lines (50 loc) · 1.94 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
name: Deploy docs site → Cloudflare Pages
# Phase 2 T8 of paycraft-v2-production-readiness — builds Docusaurus on push
# to main, uploads to Cloudflare Pages project `paycraft-docs`. PR previews
# are handled by Cloudflare's GitHub integration; this workflow owns the
# canonical production deploy. Replaces the prior `docusaurus/`-targeted +
# GitHub-Pages-targeted variant.
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'docs-site/**'
- '.github/workflows/docs-deploy.yml'
workflow_dispatch:
permissions:
contents: read
deployments: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install deps
working-directory: docs-site
run: npm install --no-audit --no-fund
- name: Build site
working-directory: docs-site
run: npm run build
- name: Deploy to Cloudflare Pages
if: env.CLOUDFLARE_API_TOKEN != ''
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy docs-site/build --project-name=paycraft-docs --branch=main
- name: Skip deploy if Cloudflare not configured
if: env.CLOUDFLARE_API_TOKEN == ''
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: |
echo "::warning::CLOUDFLARE_API_TOKEN not set — skipped Cloudflare Pages deploy."
echo "::warning::Set CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID secrets in PayCraft repo settings."
echo "::warning::Build artifact still produced at docs-site/build/ for manual upload."