Repository navigation
Run the tests on GitHub, and publish the browser demo with GitHub Pag… #1
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
| # Builds the browser demo (web/) and publishes it with GitHub Pages. | |
| # It only runs once Pages is switched on for this repository | |
| # (Settings > Pages > Source: GitHub Actions), or when started by hand. | |
| name: demo | |
| on: | |
| push: | |
| branches: [main] | |
| paths: ["web/**", "src/core.cjs", "package.json", "package-lock.json"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| if: github.event_name == 'workflow_dispatch' || github.event.repository.has_pages | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run build:web | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: web/dist | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |