Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Pull request checks
name: CI

on:
pull_request:
branches: [production]
branches: [main, production]
push:
branches: [main, production]

permissions:
contents: read
Expand All @@ -13,9 +15,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- uses: actions/setup-node@v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: npm
Expand Down
46 changes: 30 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,53 @@ on:
branches: [production]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write
# No default token permissions; each job requests only what it needs.
permissions: {}

# Queue deploys instead of cancelling one mid-deploy.
concurrency:
group: pages
cancel-in-progress: true
cancel-in-progress: false

jobs:
deploy:
# Unprivileged: installs dependencies, lints, builds and uploads the site.
build:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- uses: actions/setup-node@v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: npm

- run: npm ci
- run: npm ci --ignore-scripts
- run: npm run lint
- run: npm run build

- uses: actions/configure-pages@v5

- uses: actions/upload-pages-artifact@v3
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: dist

# Privileged: only publishes the artifact built above.
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0

- name: Deploy
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ Open the local URL printed by Vite in your browser.
- `src/data/map.ts`: loads the bundled SVG map.
- `src/assets/`: map artwork, persona portraits, and landmark imagery.

## Continuous integration and deployment

- `.github/workflows/ci.yml` runs `npm run lint` and `npm run build` on every pull request into `main` or `production` and on every push to those branches.
- Open pull requests against `main`. Merging into `main` does not deploy.
- The live site deploys from the `production` branch. `.github/workflows/deploy.yml` runs on each push to `production` (or a manual run from `production`), lints and builds the app in an unprivileged job, then publishes `dist/` to GitHub Pages in a separate job. To release, fast-forward `production` to `main` after CI passes on `main`.
Loading