-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (48 loc) · 1.59 KB
/
docs.yaml
File metadata and controls
48 lines (48 loc) · 1.59 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
name: Docs
on:
# Run after a release finishes so the published version is available and the
# generated docs header matches what's on npm. Also allow manual rebuilds.
workflow_run:
workflows: ["Release"]
types: [completed]
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
# Let in-progress Pages deployments finish; cancelling them mid-flight
# produces spurious failures (per GitHub's official Pages workflow).
cancel-in-progress: false
jobs:
build-deploy:
# On workflow_run only deploy when the release succeeded; always run manual dispatch.
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "lts/*"
- run: npm ci
- name: Set docs version from published release
run: |
VERSION=$(npm view @faable/auth-js version 2>/dev/null || true)
if [ -n "$VERSION" ]; then
npm pkg set version="$VERSION"
echo "Docs version set to $VERSION"
else
echo "Could not resolve published version; keeping package.json default"
fi
- run: npm run docs
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: docs-site
- id: deployment
uses: actions/deploy-pages@v4