-
Notifications
You must be signed in to change notification settings - Fork 5
81 lines (75 loc) · 2.09 KB
/
web.yaml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: XMUX Web
on:
push:
branches:
- master
paths:
- .github/workflows/web.yaml
- lib/**
- web/**
- pubspec.yaml
- pubspec.lock
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: subosito/flutter-action@v2
with:
channel: beta
- name: Build
run: |
FLUTTER_BUILD_NUMBER=$(git rev-list --count HEAD)
GIT_DESC=$(git describe --tags)
if [[ $GIT_DESC =~ v([0-9]+)\.([0-9]+)\.([0-9]+)-([0-9]+)-g[a-f0-9]+ ]]; then
FLUTTER_BUILD_NAME="${BASH_REMATCH[1]}.$((BASH_REMATCH[2]+1)).${BASH_REMATCH[3]}"
else
FLUTTER_BUILD_NAME="0.0.1"
fi
echo $CONFIG_ENV | base64 -d > .env
flutter build web \
--release \
--build-name=$FLUTTER_BUILD_NAME \
--build-number=$FLUTTER_BUILD_NUMBER \
--dart-define-from-file=.env \
--source-maps
env:
CONFIG_ENV: ${{ secrets.CONFIG_ENV }}
- uses: actions/upload-artifact@v4
with:
name: XMUX-Web
path: build/web
DeployGithubStatic:
runs-on: ubuntu-latest
needs: Build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: XMUX-Web
path: XMUX-Web
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.DEPLOY_STATIC }}
external_repository: XMUMY/static
publish_branch: app-web
publish_dir: ./XMUX-Web
DeployFirebase:
runs-on: ubuntu-latest
needs: Build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: XMUX-Web
path: XMUX-Web
- name: Deploy to Firebase
uses: w9jds/[email protected]
with:
args: deploy --only hosting:xmux-web
env:
PROJECT_ID: xmux-app
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}