-
Notifications
You must be signed in to change notification settings - Fork 8
46 lines (44 loc) · 1.37 KB
/
page.workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Build Demo Web Page
on:
push:
branches:
- master
tags-ignore:
- v*
jobs:
build:
name: Flutter Web build and hosting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.x'
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- name: Enable Web
run: flutter config --enable-web
working-directory: ./apps/example
- name: Install dependencies
run: flutter packages get
working-directory: ./apps/example
- name: Build Web
run: flutter build web
working-directory: ./apps/example
- name: Fix service worker for GitHub Pages
run: sed -i '/ \"\/\",$/d' apps/example/build/web/flutter_service_worker.js
- name: Deploy
run: |
cd apps/example/build/web
git init
git config user.name "CI"
git config user.email "flutter-ci@github.com"
git remote add secure-origin https://${{ secrets.ACCESS_TOKEN }}@github.com/abc873693/ap_common.git
git checkout -b gh-pages
git add .
git commit -m "Updated site"
git push --force secure-origin gh-pages