ci: Add GH workflow to build app & deploy to GH Pages; Update demo link to point at GH Pages deployment. #1
This file contains 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 GitHub Pages" | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
jobs: | ||
build: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
- name: "Set up Node.js" | ||
uses: "actions/setup-node@v4" | ||
with: | ||
node-version: "22" | ||
- run: "npm install" | ||
- run: "npm run build" | ||
- name: "Upload static files as artifact" | ||
uses: "actions/upload-pages-artifact@v3" | ||
with: | ||
path: "./dist" | ||
deploy: | ||
needs: "build" | ||
permissions: | ||
# to deploy to Pages | ||
pages: "write" | ||
# to verify the deployment originates from | ||
id-token: "write" an app | ||
runs-on: "ubuntu-latest" | ||
environment: | ||
name: "github-pages" | ||
url: "${{steps.deployment.outputs.page_url}}" | ||
steps: | ||
- name: "Deploy to GitHub Pages" | ||
uses: "actions/deploy-pages@v4" |