diff --git a/.github/workflows/deploy_flutter_web.yml b/.github/workflows/deploy_flutter_web.yml new file mode 100644 index 00000000..5a8c7110 --- /dev/null +++ b/.github/workflows/deploy_flutter_web.yml @@ -0,0 +1,51 @@ +name: Deploy Flutter Web to GitHub Pages + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: "3.38.6" + + - name: Install dependencies + run: flutter pub get + working-directory: frontend + + - name: Build web + run: flutter build web --release --base-href /syntrak-application/ + working-directory: frontend + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: frontend/build/web + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file