-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (70 loc) · 2.44 KB
/
Copy pathdeploy.yml
File metadata and controls
80 lines (70 loc) · 2.44 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
# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Mozilla Foundation
name: Build and deploy GitHub Pages
# Lightweight deploy: each per-renderer workflow (cairo.yml, mupdf.yml, …)
# already builds and publishes its own out/<name>/ to gh-pages with
# keep_files: true. This workflow only republishes the small handwritten
# pieces — index.html / harness.html / workers/ — plus the JS lint gates.
# It no longer rebuilds every renderer through Docker, which used to take
# ~60-90 min per push.
on:
push:
branches: [main]
paths:
- "build.js"
- "eslint.config.mjs"
- "harness.html"
- "harness.css"
- "harness.js"
- "package-lock.json"
- "package.json"
- "src/common/**"
- "workers/**"
- ".github/workflows/deploy.yml"
- ".github/actions/publish-to-gh-pages/**"
workflow_dispatch:
permissions: {}
concurrency:
# Serialise gh-pages publishes so two near-simultaneous main pushes don't
# race; never cancel an in-flight publish (would leave gh-pages torn).
group: deploy-pages
cancel-in-progress: false
jobs:
build-and-deploy:
name: Build and deploy site
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write # local publish-to-gh-pages action pushes to gh-pages
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
cache: npm
- name: Install npm dependencies
run: npm ci
- name: Check harness and worker code
run: |
npm run lint
npm run format:check
- name: Assemble static site
run: |
mkdir -p site
cp harness.html site/index.html
cp harness.html site/harness.html
cp harness.css site/harness.css
cp harness.js site/harness.js
cp -R workers site/workers
touch site/.nojekyll
- name: Publish to gh-pages root
# Local action — Mozilla's enterprise policy disallows
# peaceiris/actions-gh-pages. Overlays ./site onto gh-pages root
# while preserving everything per-renderer workflows already
# published to out/<name>/.
uses: ./.github/actions/publish-to-gh-pages
with:
source: site
github-token: ${{ secrets.GITHUB_TOKEN }}