-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
63 lines (54 loc) · 1.97 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
59
60
61
62
63
name: Firebase CLI Gihtub Action
description: Setup and configure Firebase CLI
branding:
icon: "box"
color: "yellow"
inputs:
packager:
description: The package manager to use to install the CLI
default: npm
version:
description: Version of firebase-tools to install
default: latest
serviceAccountKey:
description: Firebase Service Account key to use
token:
description: Firebase token to use
deprecationMessage: Auhtentication with token is deprecated in firebase-tools, use a service account key with serviceAccountKey option instead
projectId:
description: Project id to use
args:
description: Additional arguments to pass to the CLI
runs:
using: composite
steps:
- if: ${{ inputs.packager == 'pnpm' }}
name: Install firebase-tools with pnpm
shell: bash
run: pnpm add -g firebase-tools@${{ inputs.version }}
- if: ${{ inputs.packager == 'yarn' }}
name: Install firebase-tools with pnpm
shell: bash
run: yarn global add firebase-tools@${{ inputs.version }}
- if: ${{ inputs.packager == 'npm' }}
name: Install firebase-tools with pnpm
shell: bash
run: npm install -g firebase-tools@${{ inputs.version }}
- if: ${{ inputs.serviceAccountKey != '' }}
name: Create service account key file
shell: bash
run: |
echo '${{ inputs.serviceAccountKey }}' > ${{ runner.temp }}/serviceAccountKey.json
echo "GOOGLE_APPLICATION_CREDENTIALS=$(echo ${{ runner.temp }}/serviceAccountKey.json)" >> $GITHUB_ENV
- if: ${{ inputs.token != '' }}
name: Add token to FIREBASE_TOKEN env var
shell: bash
run: echo "FIREBASE_TOKEN=$(echo ${{ inputs.token }})" >> $GITHUB_ENV
- if: ${{ inputs.projectId != '' }}
name: Use firebase project
shell: bash
run: firebase use ${{ inputs.projectId }}
- if: ${{ inputs.args != '' }}
name: Launch firebase command with args
shell: bash
run: firebase ${{ inputs.args }}