Skip to content
Merged
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
73 changes: 73 additions & 0 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Deploy Demo to GitHub Pages

on:
push:
branches: [main]
paths:
- 'client/**'
- '.github/workflows/deploy-demo.yml'
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
sync-and-deploy:
name: 🎭 Sync & Deploy Demo
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout demo branch
uses: actions/checkout@v4
with:
ref: demo
fetch-depth: 0

- name: Sync main into demo
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git fetch origin main
# Merge main into demo, keeping demo's versions on conflict
git merge origin/main --no-edit -X ours || {
echo "⚠️ Merge conflict — resolving with demo branch versions"
git checkout --ours .
git add .
git commit --no-edit
}
git push origin demo

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: client/package-lock.json

- name: Install dependencies
working-directory: client
run: npm ci --legacy-peer-deps

- name: Build demo
working-directory: client
env:
REACT_APP_DEMO_MODE: 'true'
PUBLIC_URL: '/RunWatch'
run: npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: client/build

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Loading