|
| 1 | +# This file was created automatically with `myst init --gh-pages` 🪄 💚 |
| 2 | +# Ensure your GitHub Pages settings for this repository are set to deploy with **GitHub Actions**. |
| 3 | + |
| 4 | +name: MyST GitHub Pages Deploy |
| 5 | +on: |
| 6 | + push: |
| 7 | + # Runs on pushes targeting the default branch |
| 8 | + branches: [mystmd] |
| 9 | +env: |
| 10 | + # `BASE_URL` determines the website is served from, including CSS & JS assets |
| 11 | + # You may need to change this to `BASE_URL: ''` |
| 12 | + BASE_URL: /${{ github.event.repository.name }} |
| 13 | + |
| 14 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 15 | +permissions: |
| 16 | + contents: read |
| 17 | + pages: write |
| 18 | + id-token: write |
| 19 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 20 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 21 | +concurrency: |
| 22 | + group: 'pages' |
| 23 | + cancel-in-progress: false |
| 24 | +jobs: |
| 25 | + deploy: |
| 26 | + environment: |
| 27 | + name: github-pages |
| 28 | + url: ${{ steps.deployment.outputs.page_url }} |
| 29 | + runs-on: ubuntu-latest |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v4 |
| 32 | + - name: Setup Pages |
| 33 | + uses: actions/configure-pages@v3 |
| 34 | + - uses: actions/setup-node@v4 |
| 35 | + with: |
| 36 | + node-version: 18.x |
| 37 | + - name: Setup Anaconda |
| 38 | + uses: conda-incubator/setup-miniconda@v3 |
| 39 | + with: |
| 40 | + auto-update-conda: true |
| 41 | + auto-activate-base: true |
| 42 | + miniconda-version: 'latest' |
| 43 | + python-version: '3.12' |
| 44 | + environment-file: environment.yml |
| 45 | + activate-environment: quantecon |
| 46 | + - name: Install MyST Markdown |
| 47 | + run: npm install -g mystmd |
| 48 | + - name: Build HTML Assets |
| 49 | + working-directory: ./lectures |
| 50 | + run: myst build --html --execute |
| 51 | + - name: Upload artifact |
| 52 | + uses: actions/upload-pages-artifact@v3 |
| 53 | + with: |
| 54 | + path: './lectures/_build/html' |
| 55 | + - name: Deploy to GitHub Pages |
| 56 | + id: deployment |
| 57 | + uses: actions/deploy-pages@v4 |
0 commit comments