-
-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (41 loc) · 1.29 KB
/
build-and-publish-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
name: Build and publish web
on:
# Enable manual run
workflow_dispatch:
# Verify build succeeds on pull requests
pull_request:
# Verify build succeeds for tag events matching v*, i.e. v1.0.0, v20.15.10
push:
tags:
- "v*"
# Build & deploy for published releases
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Flutter
uses: subosito/flutter-action@v1
# with:
# channel: beta
- name: Get packages
run: flutter pub get
- name: Run build_runner
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Test build succeeds
if: github.event.action != 'published'
run: flutter build -v web --release
- name: Build and publish web version to GitHub Pages
if: github.event_name == 'release' && github.event.action == 'published'
uses: bluefireteam/flutter-gh-pages@v7
# baseHref must be included if the site is not going to be running
# at a subdomain, for example: myapp.example.com
#
# For example if the url was example.com/myapp then the
# baseHref should be: /myapp/
# with:
# baseHref: /myapp/