-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (79 loc) · 2.33 KB
/
build.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
name: Build
on:
push:
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Configure enviroment
uses: actions/checkout@v3
- uses: kuhnroyal/flutter-fvm-config-action@v1
- name: Download flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
cache-key: 'flutter-:os:-:version:'
cache-path: '${{ runner.tool_cache }}/flutter/:os:-:version:'
- name: Setup project
run: sh setup.sh
- name: Verify formated files
run: dart format . --set-exit-if-changed
- name: Analyze code
run: flutter analyze
- name: Build web
run: flutter build web --dart-define-from-file=.env/prod.json
- uses: actions/upload-artifact@v3
with:
name: web-app
path: build/web/
retention-days: 1
preview:
if: ${{ github.ref == 'refs/heads/main' }}
needs: build
name: Deploy preview web
runs-on: ubuntu-latest
steps:
- name: Configure enviroment
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: web-app
path: build/web
- name: HTML/CSS/JS Minifier
uses: docker://devatherock/minify-js:2.0.0
with:
directory: 'build/web'
add_suffix: false
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_PELUQUERIA_MIMOS }}'
projectId: peluqueria-mimos
channelId: preview
deployment:
if: ${{ github.ref_type == 'tag' }}
needs: build
name: Deploy web
runs-on: ubuntu-latest
steps:
- name: Configure enviroment
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: web-app
path: build/web
- name: HTML/CSS/JS Minifier
uses: docker://devatherock/minify-js:2.0.0
with:
directory: 'build/web'
add_suffix: false
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_PELUQUERIA_MIMOS }}'
projectId: peluqueria-mimos
channelId: live
- name: Release
uses: softprops/action-gh-release@v1