Add web app build and deploy to GitHub Pages root

- Add build-web job that builds the web app
- Publish web app to GitHub Pages root directory
- Keep auto-update files in /update/ subdirectory
- Web app accessible at https://jhbruhn.github.io/respira/
- Auto-update files at /update/win32/x64/ and /update/darwin/arm64/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Henrik Bruhn 2025-12-11 13:24:17 +01:00
parent e28761f127
commit 3760f05c29

View file

@ -102,9 +102,37 @@ jobs:
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-web:
name: Build Web App
needs: draft-release
if: needs.draft-release.outputs.tag-name != ''
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build web app
run: npm run build
- name: Upload web build artifact
uses: actions/upload-artifact@v4
with:
name: web-build
path: dist/
publish-to-pages: publish-to-pages:
name: Publish to GitHub Pages name: Publish to GitHub Pages
needs: [draft-release, build-release] needs: [draft-release, build-release, build-web]
if: needs.draft-release.outputs.tag-name != '' if: needs.draft-release.outputs.tag-name != ''
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: environment:
@ -117,18 +145,24 @@ jobs:
with: with:
path: artifacts path: artifacts
- name: Organize files for auto-update - name: Organize files for GitHub Pages
run: | run: |
# Create update directory structure # Create root directory for web app
mkdir -p update/win32/x64 mkdir -p pages
mkdir -p update/darwin/arm64
# Copy web build to root
cp -r artifacts/web-build/* pages/
# Create update directory structure for auto-update files
mkdir -p pages/update/win32/x64
mkdir -p pages/update/darwin/arm64
# Copy Windows auto-update files # Copy Windows auto-update files
cp artifacts/windows-artifacts/* update/win32/x64/ cp artifacts/windows-artifacts/* pages/update/win32/x64/
# Copy macOS auto-update files (only ZIP and RELEASES.json, not DMG) # Copy macOS auto-update files (only ZIP and RELEASES.json, not DMG)
cp artifacts/macos-artifacts/zip/darwin/arm64/*.zip update/darwin/arm64/ cp artifacts/macos-artifacts/zip/darwin/arm64/*.zip pages/update/darwin/arm64/
cp artifacts/macos-artifacts/zip/darwin/arm64/RELEASES.json update/darwin/arm64/ cp artifacts/macos-artifacts/zip/darwin/arm64/RELEASES.json pages/update/darwin/arm64/
- name: Setup Pages - name: Setup Pages
uses: actions/configure-pages@v4 uses: actions/configure-pages@v4
@ -136,7 +170,7 @@ jobs:
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@v3
with: with:
path: 'update' path: 'pages'
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
id: deployment id: deployment