-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.5 KB
/
build_web.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
name: Build web
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- "README.md"
- "linux/**"
- "windows/**"
- ".github/**"
- "test/**"
permissions:
contents: write
jobs:
build-web:
runs-on: ubuntu-latest
steps:
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.2"
channel: "stable"
- name: Checkout source code
uses: actions/checkout@v4
with:
path: source
ref: main
- name: Checkout GitHub Pages branch
uses: actions/checkout@v4
with:
path: target
ref: gh-pages
- name: Remove files in GiHub Pages branch
run: rm -rvf $GITHUB_WORKSPACE/target/*
- name: Build
working-directory: ${{ github.workspace }}/source
run: |
flutter pub get
flutter build web --web-renderer html --output $GITHUB_WORKSPACE/target --base-href "/MK8SE/"
- name: Push changes
working-directory: ${{ github.workspace }}/target
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Build web version"
git push