📄updated readme #19
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: CI | |
on: | |
push: | |
branches: [ master ] | |
env: | |
RESOURCE_DIR: functions | |
jobs: | |
build: | |
name: Build Firebase Functions | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Dependencies | |
run: npm ci --no-audit | |
working-directory: ${{ env.RESOURCE_DIR }} | |
- name: Build | |
run: npm run build | |
working-directory: ${{ env.RESOURCE_DIR }} | |
- name: Archive Production Artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: ${{ env.RESOURCE_DIR }} | |
path: ${{ env.RESOURCE_DIR }} | |
deploy: | |
name: Deploy Firebase Functions | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Install Dependencies | |
run: npm ci --no-audit | |
working-directory: ${{ env.RESOURCE_DIR }} | |
- name: Download Artifact | |
uses: actions/download-artifact@master | |
with: | |
name: ${{ env.RESOURCE_DIR }} | |
path: ${{ env.RESOURCE_DIR }} | |
- name: Deploy to Firebase | |
uses: w9jds/firebase-action@master | |
with: | |
args: functions:config:set sheets.api_key=${{ secrets.API_KEY }} sheets.measurement_id=${{ secrets.MEASURE_ID }} sheets.api_secret=${{ secrets.API_SECRET }} sheets.client_id=${{ secrets.CLIENT_ID }}; firebase deploy --only functions --force | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} |