Skip to content

Commit 712998e

Browse files
committed
add github action
1 parent e163ca9 commit 712998e

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/github-pages.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# NOTE THAT in addition to this file, you need to check on github.com
2+
# the Settings -> Environments tab
3+
# then select the 'github-pages' environment
4+
# and make sure the branch of interest (here myst) is allowed in the 'Branch protection rules' area
5+
6+
name: Deploy MyST to GitHub Pages
7+
8+
on:
9+
# Allows manual trigger
10+
workflow_dispatch:
11+
push:
12+
branches:
13+
- jb2
14+
15+
16+
# the following sets permissions of the GITHUB_TOKEN
17+
# to allow deployment to GitHub Pages
18+
permissions:
19+
contents: read
20+
pages: write
21+
id-token: write
22+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
23+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
24+
concurrency:
25+
group: "pages"
26+
cancel-in-progress: false
27+
28+
29+
# required for MyST
30+
env:
31+
# `BASE_URL` determines the website is served from, including CSS & JS assets
32+
# You may need to change this to `BASE_URL: ''`
33+
BASE_URL: /${{ github.event.repository.name }}
34+
35+
36+
jobs:
37+
build-and-deploy:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
- uses: actions/setup-node@v4
43+
with:
44+
node-version: 22
45+
- name: Install MyST Markdown
46+
run: npm install -g mystmd
47+
- name: Install requirements.txt
48+
run: pip install -r requirements.txt
49+
- name: Build HTML Assets
50+
run: (cd notebooks; myst build --execute --html)
51+
- name: Setup Pages
52+
uses: actions/configure-pages@v3
53+
- name: Upload artifact
54+
uses: actions/upload-pages-artifact@v3
55+
with:
56+
path: './notebooks/_build/html'
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4
60+
61+
environment:
62+
name: github-pages
63+
url: ${{ steps.deployment.outputs.page_url }}

0 commit comments

Comments
 (0)