๐ Deploy Demo to GitHub Pages #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |