Deploy sample-app web to GitHub Pages #7
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 sample-app web to GitHub Pages | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: "gh-pages-app" | |
| cancel-in-progress: true | |
| env: | |
| FLUTTER_VERSION: "3.41.4" | |
| jobs: | |
| deploy: | |
| if: github.ref_name == 'master' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./packages/sample-app | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| channel: stable | |
| cache: true | |
| cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" | |
| cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" | |
| architecture: x64 | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build web app | |
| run: flutter build web --release --base-href "/app/" | |
| - name: Copy wasm/js runtime assets | |
| run: | | |
| mkdir -p build/web/pkg | |
| cp -R web/pkg/. build/web/pkg/ | |
| cp web/drift_worker.js build/web/drift_worker.js | |
| - name: Deploy app into gh-pages /app | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./packages/sample-app/build/web | |
| destination_dir: app | |
| keep_files: true |