Skip to content

Commit 72c8e50

Browse files
committed
changes
2 parents cfb5776 + 5248b68 commit 72c8e50

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

README.md

Lines changed: 4 additions & 2 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

entrypoint.sh

Lines changed: 8 additions & 2 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,6 +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 --only functions \
1622
-m "${GITHUB_REF} (${GITHUB_SHA})" \
1723
--project ${FIREBASE_PROJECT} \

0 commit comments

Comments
 (0)