From d6077d1588c4241c35707385e97f8fc5d231cc6f Mon Sep 17 00:00:00 2001 From: Janez T Date: Wed, 4 Mar 2026 19:16:15 +0100 Subject: [PATCH] ci: add web build and GitHub Pages deployment --- .github/workflows/build-artifacts.yml | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index f0e17fa..21e6a2e 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -8,6 +8,8 @@ on: permissions: contents: write + pages: write + id-token: write env: FLUTTER_VERSION: "3.35.6" @@ -256,6 +258,49 @@ jobs: ${{ env.IOS_RUNNER_ZIP }} if-no-files-found: error + build-web: + name: Build Web App + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + channel: stable + cache: true + + - name: Enable web + run: flutter config --enable-web + + - name: Install dependencies + run: flutter pub get + + - name: Build web release + run: flutter build web --release --base-href /meshcore_sar_app/ + + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: build/web + + deploy-pages: + name: Deploy to GitHub Pages + runs-on: ubuntu-latest + needs: build-web + if: github.ref == 'refs/heads/main' + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + upload-release-assets: name: Upload Assets To Release if: github.event_name == 'release'