generated from vsoch/docsy-jekyll
-
-
Notifications
You must be signed in to change notification settings - Fork 62
94 lines (77 loc) · 2.6 KB
/
pages.yml
File metadata and controls
94 lines (77 loc) · 2.6 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
92
93
94
name: Deploy to GitHub Pages
on:
pull_request:
branches:
- main
push:
branches:
- main
merge_group:
workflow_dispatch:
schedule:
- cron: "50 6 * * 0,2" # 6:50 UTC sundays and tuesdays to generate changelog page right after builds
jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: 24
cache: npm
- name: Restore GitHub data cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with:
path: static/data
key: github-data-${{ hashFiles('scripts/fetch-github-*.js') }}-${{ github.run_number }}
restore-keys: |
github-data-${{ hashFiles('scripts/fetch-github-*.js') }}-
github-data-
- name: Install dependencies
run: npm ci
- name: Fetch data
env:
GITHUB_TOKEN: ${{ secrets.PROJECT_READ_TOKEN }}
run: npm run fetch-data
- name: Run TypeScript validation
run: npm run typecheck
- name: Run ESLint validation
run: npm run lint
- name: Run Prettier check (warnings only)
run: npm run prettier-lint || true
- name: Build website
env:
GITHUB_TOKEN: ${{ secrets.PROJECT_READ_TOKEN }}
run: npm run build
- name: Upload Build Artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
with:
path: build
deploy:
name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4