-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (58 loc) · 2.05 KB
/
Copy pathdeploy.yml
File metadata and controls
64 lines (58 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Deploy to GitHub Pages
# Builds the static app in app/ and publishes app/dist to GitHub Pages.
# Enable Pages for the repo (Settings → Pages → Source: GitHub Actions).
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment.
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
cache: npm
cache-dependency-path: app/package-lock.json
- run: npm ci
working-directory: app
- name: Configure the tracking endpoint (config.json)
# The repo commits a dev config.json (localhost). For the public demo,
# point it at a real pulse via the PULSE_ENDPOINT repo variable, or remove
# it so the demo tracks nothing (rather than shipping localhost).
working-directory: app
env:
PULSE_ENDPOINT: ${{ vars.PULSE_ENDPOINT }}
run: |
set -euo pipefail
if [ -n "${PULSE_ENDPOINT}" ]; then
printf '{\n "tracking": {\n "endpoint": "%s",\n "presence": true,\n "identity": "optional-name"\n }\n}\n' \
"${PULSE_ENDPOINT}" > public/config.json
echo "Tracking enabled → ${PULSE_ENDPOINT}"
else
rm -f public/config.json
echo "No PULSE_ENDPOINT set; tracking disabled for the demo."
fi
- run: npm run build
working-directory: app
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: app/dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0