-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (60 loc) · 2.04 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
73 lines (60 loc) · 2.04 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
name: Deploy docs
# Build the VitePress site (docs/) and publish it to the gh-pages branch, which
# GitHub Pages serves at helix.gamingtwist.uk (see docs/public/CNAME).
#
# The site is a monorepo build: docs consumes the *built dist/* of helix (for the
# live playground) and typedoc over helix/spool/twine (for the API reference), so
# CI builds bottom-up: helix -> spool/twine -> docs. Each package has its own
# committed lockfile, so CI uses `npm ci` for reproducible installs. helix's build
# re-fetches Mojang version data from misode/mcmeta at build time (needs network,
# which CI has).
on:
push:
branches: [main]
workflow_dispatch:
# peaceiris/actions-gh-pages needs write access to push the gh-pages branch.
permissions:
contents: write
# Never run two deploys at once; a newer push supersedes an in-flight build.
concurrency:
group: deploy-docs
cancel-in-progress: true
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Build helix (core compiler)
working-directory: helix
run: |
npm ci
npm run build
- name: Build spool
working-directory: spool
run: |
npm ci
npm run build
- name: Build twine
working-directory: twine
run: |
npm ci
npm run build
- name: Install docs deps
working-directory: docs
run: npm ci
- name: Generate API reference (typedoc over helix/spool/twine)
working-directory: docs
run: npm run gen:api
- name: Build the site (playground assets + vitepress build)
working-directory: docs
run: npm run build
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
# CNAME travels via docs/public/CNAME -> dist/CNAME, so the custom
# domain survives every deploy.