Skip to content

Commit bf9ef56

Browse files
committed
ci: Move web deployment from gh-pages.yml into deploy.yml
1 parent 8b10719 commit bf9ef56

2 files changed

Lines changed: 39 additions & 32 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
release:
55
types: [published]
66
workflow_dispatch:
7+
push:
8+
branches:
9+
- ci/web-deployment # TEMP: remove after testing
710

811
jobs:
912
deploy-ios:
@@ -175,3 +178,39 @@ jobs:
175178

176179
- name: Publish to Microsoft Store
177180
run: msstore publish . -v -id ${{ secrets.MICROSOFT_STORE_PRODUCT_ID }}
181+
182+
deploy-web:
183+
name: Build and Deploy Web
184+
runs-on: ubuntu-latest
185+
timeout-minutes: 15
186+
permissions:
187+
contents: write
188+
defaults:
189+
run:
190+
working-directory: example
191+
192+
steps:
193+
- uses: actions/checkout@v4
194+
195+
- uses: subosito/flutter-action@v2
196+
with:
197+
channel: stable
198+
199+
- name: Set fl_chart version
200+
working-directory: ${{ github.workspace }}
201+
run: |
202+
VERSION=$(grep "version:" pubspec.yaml | awk '{ print $2 }')
203+
echo "USING_FL_CHART_VERSION=$VERSION" >> $GITHUB_ENV
204+
205+
- run: flutter pub get
206+
207+
- name: Build web
208+
run: flutter build web --release --wasm --base-href=/ --dart-define="USING_FL_CHART_VERSION=${{ env.USING_FL_CHART_VERSION }}"
209+
210+
- name: Deploy to GitHub Pages
211+
run: |
212+
git config user.name github-actions
213+
git config user.email github-actions@github.com
214+
git --work-tree build/web add --all
215+
git commit -m "Automatic deployment by github-actions"
216+
git push origin HEAD:gh-pages --force

.github/workflows/gh-pages.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)