-
-
Notifications
You must be signed in to change notification settings - Fork 28
61 lines (51 loc) · 1.68 KB
/
deploy-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
57
58
59
60
61
name: Deploy web
on:
push:
branches:
- '**'
tags-ignore:
- '**'
workflow_dispatch:
env:
FLUTTER_VERSION: "3.24.5"
jobs:
deploy-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract branch name
id: extract-branch-name
run: |
echo ${GITHUB_REF#refs/heads/}
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- run: |
flutter --version
flutter pub get
- name: Build with default auto web-renderer
run: |
dart ./scripts/gen_git_info.dart
flutter build web --release --web-renderer auto -v --source-maps
dart ./scripts/patch_web_build.dart
- name: Publish to app repo ${{ steps.extract-branch-name.outputs.BRANCH_NAME }} branch
uses: crazy-max/ghaction-github-pages@v4
with:
repo: chaldea-center/app
target_branch: ${{ steps.extract-branch-name.outputs.BRANCH_NAME }}
build_dir: build/web
env:
GH_PAT: ${{ secrets.GH_PAGES_TOKEN }}
- uses: yizhoumo/setup-ossutil@v2
if: github.ref == 'refs/heads/main'
with:
ossutil-version: "1.7.18"
endpoint: ${{ secrets.OSS_ENDPOINT }}
access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }}
access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
- name: Publish to OSS
if: github.ref == 'refs/heads/main'
run: dart ./scripts/publish_oss.dart ${{ secrets.OSS_BUCKET_NAME }}