Repository navigation
77 lines (73 loc) · 2.86 KB
/
Copy pathdocs.yml
File metadata and controls
77 lines (73 loc) · 2.86 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
name: Docs
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.11"
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "20"
- name: Install package + docs extras
run: |
python -m pip install --upgrade pip
pip install -e ".[docs,images]"
- name: Install MyST CLI
# Pinned: an unpinned global npm install floats to whatever mystmd
# released today, and its CLI has had breaking changes between minors.
# Dependabot does not see npm installs inside run steps — bump by hand.
run: npm install -g mystmd@1.10.1
- name: Build site
working-directory: docs
env:
# The site serves from the /processbehavior/ subpath on Pages;
# without this, myst emits root-relative asset URLs that 404 there.
BASE_URL: /processbehavior
run: myst build --html
- name: Point sitemap and robots at the public URL
# mystmd's static export hardcodes localhost:3000 in sitemap.xml and
# robots.txt (site.domains only applies to its hosted deploys).
working-directory: docs
run: |
sed -i 's|http://localhost:3000|https://cnicholas.github.io/processbehavior|g' \
_build/html/sitemap.xml _build/html/robots.txt
- name: Inject Google Search Console verification tag
# Google checks the property root for this tag; mystmd 1.10.1 has no
# head-injection hook, so it goes in post-build.
working-directory: docs
run: |
sed -i 's|<head>|<head><meta name="google-site-verification" content="DU_vmXbk9SxCOd3mNHKYljEZZFbVluUofDkZg7cTYzk"/>|' \
_build/html/index.html
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: docs/_build/html
deploy:
# Only main deploys. PRs build to catch a broken TOC or a dead file
# reference before it lands, which a push-only trigger could not do.
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
# Scoped to the deploy job so concurrent PR builds do not queue behind
# each other on the shared `pages` group.
concurrency:
group: pages
cancel-in-progress: true
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1