Skip to content

๐Ÿš€ Deploy Demo to GitHub Pages #6

๐Ÿš€ Deploy Demo to GitHub Pages

๐Ÿš€ Deploy Demo to GitHub Pages #6

Workflow file for this run

name: ๐Ÿš€ Deploy Demo to GitHub Pages
# ๆ‰‹ๅ‹•่งธ็™ผ
on:
workflow_dispatch:
inputs:
environment:
description: 'Deployment environment'
required: false
default: 'demo'
type: choice
options:
- demo
- staging
# ่จญๅฎš GitHub Pages ๆ‰€้œ€็š„ๆฌŠ้™
permissions:
contents: read
pages: write
id-token: write
# ้ฟๅ…ๅŒๆ™‚้ƒจ็ฝฒ่ก็ช
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
name: ๐Ÿ—๏ธ Build Demo Web
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: ๐Ÿ“ฅ Checkout
uses: actions/checkout@v4
- name: ๐Ÿฆ Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
# Setup SSH for private dependencies (same as ci.yml)
- name: ๐Ÿ”‘ Setup SSH for Private Deps
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.UI_KIT_DEPLOY_KEY }}
- name: ๐Ÿ”„ Configure Git to use SSH
run: git config --global url."git@github.com:".insteadOf "https://github.com/"
- name: ๐Ÿ“ฆ Install Dependencies
run: flutter pub get
- name: ๐ŸŒ Build Web (Demo Mode)
run: |
flutter build web \
--release \
--target=lib/main_demo.dart \
--base-href "/PrivacyGUI/demo/"
- name: ๏ฟฝ Prepare Deploy Structure
run: |
mkdir -p deploy/demo
mv build/web/* deploy/demo/
- name: ๏ฟฝ๐Ÿ“ค Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: deploy
deploy:
name: ๐Ÿš€ Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: ๐ŸŒ Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4