aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/build-frontend.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/build-frontend.yml')
-rw-r--r--.github/workflows/build-frontend.yml46
1 files changed, 46 insertions, 0 deletions
diff --git a/.github/workflows/build-frontend.yml b/.github/workflows/build-frontend.yml
new file mode 100644
index 000000000..dedf67f3c
--- /dev/null
+++ b/.github/workflows/build-frontend.yml
@@ -0,0 +1,46 @@
+name: Build and Commit Frontend
+
+on:
+ push:
+ branches:
+ - master
+ - development
+ - 'ci-test*' # This will match any branch that starts with "ci-test"
+ paths:
+ - 'frontend/**'
+
+jobs:
+ build:
+ permissions:
+ contents: write
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Repo
+ uses: actions/checkout@v2
+ - name: Setup Flutter
+ uses: subosito/flutter-action@v1
+ with:
+ flutter-version: '3.13.2'
+ - name: Build Flutter Web
+ run: |
+ cd frontend
+ flutter build web --base-href /app/
+ - name: Set branch name
+ id: vars
+ run: echo "::set-output name=branch::frontend_build_${GITHUB_SHA}"
+ - name: Commit and Push
+ run: |
+ git config --local user.email "action@github.com"
+ git config --local user.name "GitHub Action"
+ git add frontend/build/web
+ git commit -m "Update frontend build" -a
+ git checkout -b ${{ steps.vars.outputs.branch }}
+ echo "Commit hash: ${GITHUB_SHA}"
+ git push origin ${{ steps.vars.outputs.branch }}
+ # - name: Create Pull Request
+ # uses: peter-evans/create-pull-request@v3
+ # with:
+ # title: "Update frontend build"
+ # body: "This PR updates the frontend build."
+ # branch: ${{ steps.vars.outputs.branch }}
+ # base: "master"