-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (55 loc) · 1.62 KB
/
deploy.yml
File metadata and controls
72 lines (55 loc) · 1.62 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
name: Jupyter Book v2 (MyST) GitHub Pages Deploy
on:
push:
branches: [main]
workflow_dispatch:
env:
BASE_URL: /${{ github.event.repository.name }}
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v3
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install MyST Markdown (mystmd)
run: npm install -g mystmd
- name: Build HTML Assets
id: build
run: |
set -euxo pipefail
# Find the MyST/Jupyter Book v2 project root
MYST_FILE="$(find . -maxdepth 3 -name myst.yml -print -quit || true)"
if [ -z "$MYST_FILE" ]; then
echo "ERROR: Could not find myst.yml (Jupyter Book v2 requires it)."
echo "Repo contents:"
ls -lah
exit 1
fi
MYST_DIR="$(cd "$(dirname "$MYST_FILE")" && pwd)"
echo "Building from: $MYST_DIR"
cd "$MYST_DIR"
myst build --html
test -d _build/html
ls -lah _build/html
echo "html_path=$MYST_DIR/_build/html" >> "$GITHUB_OUTPUT"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ steps.build.outputs.html_path }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4