-
Notifications
You must be signed in to change notification settings - Fork 3
67 lines (57 loc) · 1.77 KB
/
deploy.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Flutter Build and Deploy to GitHub Pages
on:
push:
branches:
- main
concurrency:
group: auto-deploy
cancel-in-progress: true
jobs:
build_web:
name: Build Flutter Web, Take Screenshots and Deploy
runs-on: ubuntu-latest
steps:
- name: Get the branch name
run: echo "Current branch name is ${{ github.ref_name }}"
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
# channel: "master"
cache: true
- name: Install Flutter Dependencies
run: flutter pub get
- name: setup chrome
uses: nanasess/setup-chromedriver@v2
- name: 🎯 Take screenshots
run: |
flutter test --update-goldens
- name: Build Flutter Web
run: flutter build web --release --base-href "/bouncy_ball_physics/" --web-renderer canvaskit
# - name: Build Flutter Web wasm
# run: flutter build web --wasm --release --base-href "/bouncy_ball_physics/" --web-renderer canvaskit
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web
# publish_dir: ./build/web_wasm
- name: Fetch and Merge Changes from Main
run: |
git fetch
git pull
- name: Auto Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Chore: update screenshot"
file_pattern: "**/*.png"
repository: .
skip_fetch: false
- name: list all files
run: |
ls -a
- name: git changes
run: |
git status