Add contact support #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Firebase Function, Indexes and Rules | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Cache Dependencies | |
uses: actions/cache@v4 | |
id: cache-dependencies | |
with: | |
path: | | |
~/.npm | |
~/.cache/firebase | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Dependencies | |
working-directory: functions | |
run: | | |
npm install | |
- name: Install Firebase CLI | |
run: | | |
npm install -g firebase-tools | |
- name: Authenticate Firebase using the service account and deploy | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | |
run: | | |
# Decode and set service account credentials | |
echo $GOOGLE_APPLICATION_CREDENTIALS | base64 --decode > google-application-credentials.json | |
export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/google-application-credentials.json | |
# Sync Firestore Indexes | |
firebase firestore:indexes > firestore.indexes.json | |
# Deploy Firestore Rules and Indexes | |
firebase deploy --only firestore:rules,firestore:indexes --force --non-interactive | |
- name: Remove credentials file | |
if: success() || failure() | |
run: | | |
rm google-application-credentials.json |