-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
58 lines (58 loc) · 1.91 KB
/
action.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
50
51
52
53
54
55
56
57
58
name: 'Deploy to Preview Channel'
description: 'Compiles and deploys a Flutter package to a preview-channel.'
inputs:
flutter-version:
description: 'The version of Flutter to compile with.'
required: true
flutter-channel:
description: 'The Flutter channel to checkout into.'
required: true
firebase-service-account:
description: 'The Firebase service account to deploy with.'
required: true
firebase-project-id:
description: 'The Firebase project ID.'
required: true
target:
description: 'The target to deploy to.'
required: true
entry-point:
description: 'The directory of the Flutter package to deploy.'
required: true
github-token:
description: 'The token to use for commenting on PRs'
required: true
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ inputs.flutter-version }}
channel: ${{ inputs.flutter-channel }}
cache: true
cache-key: flutter
cache-path: ${{ runner.tool_cache }}/flutter
- name: Cache dependencies
id: cache
uses: actions/cache@v2
with:
path: ${{ env.PUB_CACHE }}
key: pubcache-${{ hashFiles(format('{0}/pubspec.yaml', inputs.entry-point)) }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{ inputs.entry-point }}
shell: bash
run: flutter pub get
- name: Compile
working-directory: ${{ inputs.entry-point }}
shell: bash
run: flutter build web --release
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ inputs.github-token }}
projectId: ${{ inputs.firebase-project-id }}
entryPoint: ${{ inputs.entry-point }}
firebaseServiceAccount: ${{ inputs.firebase-service-account }}
target: ${{ inputs.target }}
expires: 30d