|
1 | 1 | name: MyST GitHub Pages Deploy |
| 2 | + |
2 | 3 | on: |
3 | 4 | push: |
4 | 5 | branches: [myst_build] |
5 | | -# env: |
6 | | -# BASE_URL: /${{ github.event.repository.name }} |
7 | 6 |
|
8 | 7 | permissions: |
9 | 8 | contents: read |
10 | 9 | pages: write |
11 | 10 | id-token: write |
| 11 | + |
12 | 12 | concurrency: |
13 | 13 | group: 'pages' |
14 | 14 | cancel-in-progress: false |
| 15 | + |
15 | 16 | jobs: |
16 | 17 | deploy: |
17 | 18 | environment: |
18 | 19 | name: github-pages |
19 | 20 | url: ${{ steps.deployment.outputs.page_url }} |
| 21 | + |
20 | 22 | runs-on: ubuntu-latest |
| 23 | + |
21 | 24 | steps: |
22 | 25 | - uses: actions/checkout@v4 |
23 | | - - name: Setup Pages |
| 26 | + |
| 27 | + - name: Setup GitHub Pages |
24 | 28 | uses: actions/configure-pages@v3 |
| 29 | + |
25 | 30 | - name: Cache Notebook Execution |
26 | 31 | uses: actions/cache@v3 |
27 | 32 | id: cache-execution |
28 | 33 | with: |
29 | 34 | path: ./lectures/_build/execute |
30 | 35 | key: ${{ runner.os }}-execute-cache-${{ hashFiles('lectures/**/*.md') }} |
| 36 | + |
31 | 37 | - uses: actions/setup-node@v4 |
32 | 38 | with: |
33 | 39 | node-version: 18.x |
| 40 | + |
34 | 41 | - name: Install Python |
35 | 42 | if: steps.cache-execution.outputs.cache-hit != 'true' |
36 | 43 | uses: actions/setup-python@v5 |
37 | 44 | with: |
38 | 45 | python-version: '3.12' |
39 | 46 | cache: 'pip' |
40 | 47 | cache-dependency-path: 'myst_requirements.txt' |
41 | | - - name: Install execution requirements for ipykernel and jupyter-server |
| 48 | + |
| 49 | + - name: Install execution requirements |
42 | 50 | if: steps.cache-execution.outputs.cache-hit != 'true' |
43 | 51 | run: python -m pip install -r myst_requirements.txt |
44 | | - shell: bash |
45 | | - - name: Install MyST Markdown |
| 52 | + |
| 53 | + - name: Install MyST Markdown CLI |
46 | 54 | run: npm install -g mystmd |
47 | | - - name: Build HTML Assets |
| 55 | + |
| 56 | + - name: Build HTML |
48 | 57 | working-directory: ./lectures |
49 | 58 | run: myst build --html --execute |
50 | | - - name: Upload artifact |
| 59 | + |
| 60 | + - name: Upload build output |
51 | 61 | uses: actions/upload-pages-artifact@v3 |
52 | 62 | with: |
53 | 63 | path: './lectures/_build/html' |
54 | | - - name: Deploy to gh-pages |
55 | | - uses: peaceiris/actions-gh-pages@v3 |
56 | | - with: |
57 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
58 | | - publish_dir: lectures/_build/html |
59 | | - # publish_branch: myst-build-test |
| 64 | + |
| 65 | + - name: Deploy to GitHub Pages |
| 66 | + id: deployment |
| 67 | + uses: actions/deploy-pages@v4 |
0 commit comments