Update .gitignore to exclude all lecture notebooks and add VSCode set… #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Deploy a MyST site to GitHub Pages with code execution | |
| name: MyST (exec) -> GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| env: | |
| BASE_URL: /${{ github.event.repository.name }} | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Ensure only one Pages deploy runs at a time; don't cancel in-progress jobs | |
| concurrency: | |
| group: 'pages' | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| # Node for the MyST CLI | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18.x' | |
| # Python for kernels + your project deps | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| # Install runtime deps needed for executed code cells (Python side) | |
| - name: Install Python execution deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then | |
| pip install -r requirements.txt | |
| else | |
| pip install \ | |
| ipykernel \ | |
| jupyter-server jupyter-client nbclient nbformat traitlets tornado pyzmq \ | |
| numpy scipy pandas matplotlib ase jupytext scikit-learn torch torchvision mace-torch seaborn openpyxl | |
| fi | |
| # Install the MyST CLI (Node side) | |
| - name: Install MyST CLI | |
| run: npm install -g mystmd | |
| # Build the site and EXECUTE code cells | |
| - name: Build HTML with execution | |
| run: myst build --execute --html | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./_build/html | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |