mirror of
https://github.com/jhbruhn/respira.git
synced 2026-01-27 02:13:41 +00:00
87 lines
2.4 KiB
YAML
87 lines
2.4 KiB
YAML
name: Publish to GitHub Pages
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
build-web:
|
|
name: Build Web App
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: ".node-version"
|
|
cache: "npm"
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build web app
|
|
run: npm run build -- --base=/respira/
|
|
|
|
- name: Upload web build artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: web-build
|
|
path: dist/
|
|
|
|
publish-to-pages:
|
|
name: Publish to GitHub Pages
|
|
needs: build-web
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download web build artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: web-build
|
|
path: web-build
|
|
|
|
- name: Download release assets
|
|
run: |
|
|
# Create directory structure
|
|
mkdir -p pages/update/win32/x64
|
|
mkdir -p pages/update/darwin/arm64
|
|
|
|
# Copy web build to root
|
|
cp -r web-build/* pages/
|
|
|
|
# Download Windows auto-update files from the release
|
|
gh release download ${{ github.event.release.tag_name }} --pattern "*.exe" --dir pages/update/win32/x64
|
|
gh release download ${{ github.event.release.tag_name }} --pattern "*.nupkg" --dir pages/update/win32/x64
|
|
gh release download ${{ github.event.release.tag_name }} --pattern "RELEASES" --dir pages/update/win32/x64
|
|
|
|
# Download macOS auto-update files from the release
|
|
gh release download ${{ github.event.release.tag_name }} --pattern "*-darwin-arm64-*.zip" --dir pages/update/darwin/arm64
|
|
gh release download ${{ github.event.release.tag_name }} --pattern "RELEASES.json" --dir pages/update/darwin/arm64
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Setup Pages
|
|
uses: actions/configure-pages@v4
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: "pages"
|
|
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|