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