Skip to content

Run the tests on GitHub, and publish the browser demo with GitHub Pag… #1

Run the tests on GitHub, and publish the browser demo with GitHub Pag…

Run the tests on GitHub, and publish the browser demo with GitHub Pag… #1

Workflow file for this run

# 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