Skip to content

Commit 5248b68

Browse files
authored
Merge pull request #1 from dheshalj/patch-2
Patch 2
2 parents c1c16fa + 93c9f43 commit 5248b68

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:14-slim
1+
FROM node:current-slim
22
RUN npm install -g firebase-tools
33
COPY entrypoint.sh /usr/local/bin
44
ENTRYPOINT ["entrypoint.sh"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
build:
2-
docker build . -t jsryudev/deploy-firebase-functions
2+
docker build . -t dayzero-eng/deploy-firebase-functions

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# Deploy to Firebase Functions for Node14
1+
# Deploy to Firebase for Node18
22

3-
A GitHub Action to deploy to Firebase Cloud Functions for Node14.
3+
A GitHub Action to deploy to Firebase for Node18.
44

55
- Make sure that you checkout the repository using the [actions/checkout](https://github.com/actions/checkout) action
66
- Make sure that you have the `firebase.json` file in the repository
77
- To obtain the Firebase token, run `firebase login:ci` on your local computer and [store the token](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) as the `FIREBASE_TOKEN` secret
8+
- To obtain service account credentials, get the service account JSON file from Firebase console and set its path to `GOOGLE_APPLICATION_CREDENTIALS`
9+
- Either `FIREBASE_TOKEN` or `GOOGLE_APPLICATION_CREDENTIALS` are required to deploy the project. No need to set both at the same time.
810
- Specify the Firebase project name in the `FIREBASE_PROJECT` env var
911

1012
## Workflow examples
@@ -23,7 +25,7 @@ jobs:
2325
runs-on: ubuntu-latest
2426
steps:
2527
- uses: actions/checkout@v2
26-
- uses: jsryudev/[email protected].2
28+
- uses: dayzero-eng/[email protected].5
2729
env:
2830
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
2931
FIREBASE_PROJECT: firebase-project-id
@@ -43,7 +45,7 @@ jobs:
4345
runs-on: ubuntu-latest
4446
steps:
4547
- uses: actions/checkout@v2
46-
- uses: jsryudev/[email protected].2
48+
- uses: dayzero-eng/[email protected].5
4749
env:
4850
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
4951
FIREBASE_PROJECT: firebase-project-id

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: 'Deploy to Firebase Cloud Functions'
2-
author: 'jsryudev <[email protected]>'
3-
description: 'A GitHub Action to deploy to Firebase Cloud Functions'
1+
name: 'Deploy to Firebase'
2+
author: 'dayzero-eng'
3+
description: 'A GitHub Action to deploy to Firebase'
44
runs:
55
using: 'docker'
66
image: 'Dockerfile'

entrypoint.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#!/bin/bash
22

3+
npm install
4+
35
cd functions; npm install
46

5-
if [ -z "${FIREBASE_TOKEN}" ]; then
6-
echo "FIREBASE_TOKEN is missing"
7+
if [[ -z "${FIREBASE_TOKEN}" && -z "${GOOGLE_APPLICATION_CREDENTIALS}" ]]; then
8+
echo "Access tokens are missing! Provide either FIREBASE_TOKEN or GOOGLE_APPLICATION_CREDENTIALS"
79
exit 1
810
fi
911

@@ -12,7 +14,10 @@ if [ -z "${FIREBASE_PROJECT}" ]; then
1214
exit 1
1315
fi
1416

17+
cd ..
18+
19+
firebase experiments:enable webframeworks
20+
1521
firebase deploy \
1622
-m "${GITHUB_REF} (${GITHUB_SHA})" \
1723
--project ${FIREBASE_PROJECT} \
18-
--only functions

0 commit comments

Comments
 (0)