|
1 |
| -# This file was created automatically with `myst init --gh-pages` 🪄 💚 |
| 1 | +name: deploy-book |
2 | 2 |
|
3 |
| -name: MyST GitHub Pages Deploy |
| 3 | +# Only run this when the master branch changes |
4 | 4 | on:
|
5 | 5 | push:
|
6 |
| - # Runs on pushes targeting the default branch |
7 |
| - branches: [main] |
8 |
| -env: |
9 |
| - # `BASE_URL` determines the website is served from, including CSS & JS assets |
10 |
| - # You may need to change this to `BASE_URL: ''` |
11 |
| - BASE_URL: /${{ github.event.repository.name }} |
| 6 | + branches: |
| 7 | + - master |
| 8 | + # If your git repository has the Jupyter Book within some-subfolder next to |
| 9 | + # unrelated files, you can make this run only if a file within that specific |
| 10 | + # folder has been modified. |
| 11 | + # |
| 12 | + # paths: |
| 13 | + # - some-subfolder/** |
12 | 14 |
|
13 |
| -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
14 |
| -permissions: |
15 |
| - contents: read |
16 |
| - pages: write |
17 |
| - id-token: write |
18 |
| -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
19 |
| -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
20 |
| -concurrency: |
21 |
| - group: 'pages' |
22 |
| - cancel-in-progress: false |
| 15 | +# This job installs dependencies, builds the book, and pushes it to `gh-pages` |
23 | 16 | jobs:
|
24 |
| - deploy: |
25 |
| - environment: |
26 |
| - name: github-pages |
27 |
| - url: ${{ steps.deployment.outputs.page_url }} |
| 17 | + deploy-book: |
28 | 18 | runs-on: ubuntu-latest
|
29 | 19 | steps:
|
30 |
| - - uses: actions/checkout@v4 |
31 |
| - - name: Setup Pages |
32 |
| - uses: actions/configure-pages@v3 |
33 |
| - - uses: actions/setup-node@v4 |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + |
| 24 | + - name: Setup mamba environment to run notebooks |
| 25 | + uses: mamba-org/provision-with-micromamba@main |
34 | 26 | with:
|
35 |
| - node-version: 18.x |
36 |
| - - name: Install MyST Markdown |
37 |
| - run: npm install -g mystmd |
38 |
| - - name: Build HTML Assets |
39 |
| - run: myst build --html |
40 |
| - - name: Upload artifact |
41 |
| - uses: actions/upload-pages-artifact@v1 |
| 27 | + environment-file: binder/environment.yml |
| 28 | + extra-specs: | |
| 29 | + jupyter-book |
| 30 | +
|
| 31 | + # Build the book |
| 32 | + - name: Build the book |
| 33 | + shell: bash -l {0} |
| 34 | + run: | |
| 35 | + jupyter-book build . |
| 36 | +
|
| 37 | + # Push the book's HTML to github-pages |
| 38 | + - name: GitHub Pages action |
| 39 | + |
42 | 40 | with:
|
43 |
| - path: './_build/html' |
44 |
| - - name: Deploy to GitHub Pages |
45 |
| - id: deployment |
46 |
| - uses: actions/deploy-pages@v2 |
| 41 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 42 | + publish_dir: ./_build/html |
0 commit comments