From 2fedc3d0627254bea15e67d630917c928498edeb Mon Sep 17 00:00:00 2001 From: Thea Choem <29684683+theachoem@users.noreply.github.com> Date: Thu, 14 Mar 2024 11:36:23 +0700 Subject: [PATCH] deploy with github action --- .github/workflows/build_flutter.yml | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/build_flutter.yml diff --git a/.github/workflows/build_flutter.yml b/.github/workflows/build_flutter.yml new file mode 100644 index 0000000..6ddfc64 --- /dev/null +++ b/.github/workflows/build_flutter.yml @@ -0,0 +1,46 @@ +name: Deploy Flutter + +on: + push: + branches: ["develop"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + flutter_version: [3.13.1] + flutter_path: ["/opt/hostedtoolcache/flutter"] + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Load Flutter SDK from Cache + uses: actions/cache@v3.2.6 + with: + path: ${{ matrix.flutter_path }} + key: ${{ runner.os }}-flutter-${{ matrix.flutter_version }} + + - name: Setup Flutter SDK + uses: subosito/flutter-action@v2.8.0 + with: + flutter-version: ${{ matrix.flutter_version }} + + - name: Install Packages + run: flutter pub get + + - name: Build Flutter Web + run: flutter build web --release + + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: build/web + branch: develop