-
-
Notifications
You must be signed in to change notification settings - Fork 27
91 lines (70 loc) · 1.96 KB
/
build-gh-pages.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
82
83
84
85
86
87
88
89
90
91
name: Build the example and docs website
on:
push:
branches:
- main
jobs:
build_demo:
name: Build flutter_deck demo presentation
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/flutter_deck/example
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install dependencies
run: flutter pub get
- name: Replace index.html
run: mv web/gh_pages.index.html web/index.html
- name: Build web
run: flutter build web --release --web-renderer=canvaskit
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: demo-presentation
path: ./packages/flutter_deck/example/build/web
if-no-files-found: error
build_docs:
name: Build flutter_deck docs website
needs: build_demo
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./doc/website
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Dart
uses: dart-lang/setup-dart@v1
- name: Install dependencies
run: dart pub get
- name: Build docs website
run: dart run bin/main.dart
- name: Download flutter_deck demo presentation
uses: actions/download-artifact@v4
with:
name: demo-presentation
path: ./doc/website/build/demo
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./doc/website/build
deploy:
name: Deploy to GitHub Pages
needs: build_docs
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4