Merge pull request #73 from theaiscope/dependabot/npm_and_yarn/functi… #40
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: Firebase functions deployment | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
uses: ./.github/workflows/test-workflow.yml | |
build: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: './functions/.nvmrc' | |
cache: yarn | |
cache-dependency-path: ./functions/yarn.lock | |
- name: Install dependencies | |
run: | | |
cd functions | |
yarn install | |
- name: Deploy to Firebase test | |
uses: w9jds/firebase-action@master | |
with: | |
args: deploy --only functions -P test | |
env: | |
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY_TEST }} | |
- name: Deploy to Firebase prod | |
uses: w9jds/firebase-action@master | |
with: | |
args: deploy --only functions -P default | |
env: | |
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} |