Add workflow to deploy to GH pages w/ JupyterLite #5
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
| name: "Deploy to GH Pages with JupyterLite" | |
| on: | |
| # TODO: Remove pull_request trigger | |
| pull_request: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| # Allow one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| env: | |
| UV_SYSTEM_PYTHON: 1 | |
| jobs: | |
| build: | |
| name: "python" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - uses: "actions/checkout@v5" | |
| - name: "Install uv" | |
| uses: "astral-sh/setup-uv@v6" | |
| - name: "Build our extensions" | |
| run: | | |
| uv run --extra dev jupyter labextension develop . --overwrite | |
| uv run --extra dev jupyter server extension enable myextension | |
| uv run --extra dev jlpm build | |
| - name: "Build JupyterLite" | |
| run: "uv run --extra dev --with jupyterlite --with jupyterlite-xeus jupyter lite build" | |
| - name: "Upload site artifact" | |
| uses: "actions/upload-pages-artifact@v3" | |
| with: | |
| path: "./_output" | |
| deploy: | |
| runs-on: "ubuntu-latest" | |
| needs: "build" | |
| environment: | |
| name: "github-pages" | |
| url: "${{ steps.deployment.outputs.page_url }}" | |
| permissions: | |
| pages: "write" | |
| id-token: "write" | |
| steps: | |
| - name: "Deploy to GitHub Pages" | |
| id: "deployment" | |
| uses: "actions/deploy-pages@v4" |