Build and Deploy GitHub Pages #64
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: Build and Deploy GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| repository_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| cache: true | |
| - name: Install dependencies | |
| run: deno install --allow-scripts=npm:puppeteer | |
| - name: Check | |
| run: deno task check | |
| - name: Build Screenshots | |
| run: deno task screenshots | |
| - name: Build Pages | |
| run: deno task build | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Build LiveCodes | |
| run: ./scripts/build_livecodes.sh | |
| - name: Upload static files as artifact | |
| id: deployment | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/ | |
| deploy: | |
| needs: build | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |