-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (37 loc) · 1.51 KB
/
deploy.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
name: Build Static Website branch from Widgetbook directory from branch release/widgetbook-production
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.19.6"
- name: Clean flutter to be able to generate flutter.js every build
run: flutter clean
working-directory: ./widgetbook
- name: Install dependencies
run: flutter pub get
working-directory: ./widgetbook
- name: Build serialize data
run: flutter pub run build_runner build --delete-conflicting-outputs
working-directory: ./widgetbook
- name: Build web
run: flutter build web --web-renderer canvaskit --release
working-directory: ./widgetbook
- name: Set Publish Branch
id: set_publish_branch
run: echo "publish_branch=release/flutter-web-production" >> $GITHUB_ENV
- name: Deploy to GitHub Pages/Branch for release playground
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.PAT_TOKEN }} # We use Personal access token instead of Github token since it is set to create a branch container the static page generated from flutter
publish_dir: widgetbook/build/web
publish_branch: ${{ env.publish_branch }}