-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (78 loc) · 2.55 KB
/
Copy pathdocs.yml
File metadata and controls
90 lines (78 loc) · 2.55 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
name: Docs
on:
push:
branches: [master]
paths:
- "docs/**"
- ".github/workflows/docs.yml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- uses: actions/checkout@v6
- name: Set up pnpm
uses: pnpm/action-setup@v6
with:
version: 10
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "22"
cache: pnpm
cache-dependency-path: docs/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build Fumadocs site
env:
DOCS_BASE_PATH: /dagron
run: pnpm build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/out
# Mirrored into docs.byteveda.org/<slug>/ by ByteVeda/byteveda.site.
# upload-pages-artifact keeps its artifact for 1 day, too short for the
# portal's next build to fetch, so publish a longer-lived copy.
- name: Upload docs for the portal mirror
uses: actions/upload-artifact@v7
with:
name: docs-dist
path: docs/out
retention-days: 90
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
# Rebuilds docs.byteveda.org/dagron/ now instead of at the portal's next
# cron. The run id is passed because this run is still in progress here, so
# the portal cannot find it as the latest successful docs.yml run — it would
# mirror the build before this one.
# Pages is already published by the step above, so a failed ping costs
# freshness, not the release — the portal's daily cron still catches up.
# Annotate instead of failing the deploy.
- name: Notify docs portal
env:
GH_TOKEN: ${{ secrets.DOCS_DISPATCH_TOKEN }}
run: |
gh api repos/ByteVeda/byteveda.site/dispatches \
-f event_type=tool-docs-published \
-f "client_payload[slug]=dagron" \
-f "client_payload[run_id]=${{ github.run_id }}" ||
echo "::error::docs portal dispatch failed — docs.byteveda.org/dagron/ refreshes on the portal's daily cron instead"