-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.46 KB
/
Copy pathmain.yml
File metadata and controls
56 lines (54 loc) · 1.46 KB
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
47
48
49
50
51
52
53
54
55
56
name: Flutter Web Build CI
on:
push:
paths:
- 'lib/**'
- '.github/**'
- '*.yaml'
- 'android/**'
- 'ios/**'
- 'web/**'
- 'macos/**'
branches:
- master
jobs:
build-release:
runs-on: macos-latest
steps:
- uses: actions/checkout@main
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
flutter-version: '1.20.x' # you can use 1.12:
channel: 'beta'
- run: flutter config --enable-web
- run: flutter pub get
- name: build
run: |
flutter build web --release
cd build
mv -f web/* ../
- name: Commit files
run: |
git config --local user.email "guochenghaha@gmail.com"
git config --local user.name "TinoGuo"
git add .
git reset -- pubspec.lock
git checkout HEAD -- pubspec.lock
git status
git commit -m "update artifact"
git checkout gh-pages
git cherry-pick master --strategy-option theirs
git status
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
# directory: temp1234
force: true