-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 1.58 KB
/
deploy_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
name: "Deploy Web App to Github Pages"
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4
- name: 🤫 Set API Keys
run: echo $API_KEYS_JSON | base64 -d > api-keys.json
env:
API_KEYS_JSON: ${{ secrets.API_KEYS_JSON }}
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
with:
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- name: 📦 Install Dependencies
run: |
flutter pub get
- name: ⚙️ Run Code Generation
run: |
flutter pub run build_runner build --delete-conflicting-outputs
flutter pub get
- name: 🌏 Enable Web
run: |
flutter config --enable-web
- name: 🛠️ Build Web
run: flutter build web --release -t lib/main.dart --dart-define-from-file api-keys.json --wasm
- name: 🤖 Configure Github Actions
run: |
git config user.name github-actions
git config user.email [email protected]
- name: 🎄 Extract Web Build
run: |
git --work-tree build/web add --all
git add .well-known --all
git add _config.yml
- name: 🚀 Push to gh-pages
run: |
git commit -m "Automatic deployment by github-actions"
git push origin HEAD:gh-pages --force