Repository navigation
81 lines (72 loc) · 2.22 KB
/
Copy pathbuild_docs.yml
File metadata and controls
81 lines (72 loc) · 2.22 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
on:
push:
paths:
- .github/workflows/build_docs.yml
- docs/**
- scripts/fetch-kit.mjs
- docs.config.ts
- vite.config.ts
- tsconfig.json
- package.json
- package-lock.json
branches:
- '**'
# levimc-kit (the LeviMC bar, footer and docs engine) is published by levimc.org and fetched by `npm ci`:
# levimc.org triggers this workflow when it publishes a new kit, and the hourly check below catches up otherwise.
schedule:
- cron: '41 * * * *'
workflow_dispatch:
jobs:
# On the schedule: build only when levimc.org publishes a kit the live site does not run yet.
kit:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
outputs:
stale: ${{ steps.check.outputs.stale }}
steps:
- id: check
run: |
want=$(curl -fsSL https://levimc.org/kit/v2/manifest.json | jq -r '"levimc-kit " + .version + "+" + .build')
have=$(curl -fsSL https://docs.levimc.org/LegacyScriptEngine/ | grep -o 'levimc-kit [^"]*' | head -1)
echo "live: $have · published: $want"
echo "stale=$([ "$want" != "$have" ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
build:
needs: kit
if: ${{ !cancelled() && (github.event_name != 'schedule' || needs.kit.outputs.stale == 'true') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0 # full history for the "Last updated" dates
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
- run: |
npm ci
- run: |
npm run typecheck
- run: |
npm run build
- run: |
npm run linkcheck
- uses: actions/upload-pages-artifact@v5
with:
path: dist/
deploy:
if: ${{ !cancelled() && needs.build.result == 'success' && github.ref == 'refs/heads/develop' }}
needs:
- build
permissions:
id-token: write
pages: write
concurrency:
group: pages
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- id: deployment
uses: actions/deploy-pages@v5