Skip to content

Commit

Permalink
fix: try using different action to deploy functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jkklapp committed May 23, 2022
1 parent 705744c commit 489cc79
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions .github/workflows/firebase-functions-develop.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
name: Preview functions in firebase

# Controls when the workflow will run
'on':
#triggers the workflow whenever a push is made to the main branch
push:
branches:
- develop

jobs:
#this workfloe has only one job
build_and_preview:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# this install the dependencies specified in your package.json file into the current workflow
- name: install dependencies
# navigates to your functions folder and install the dependencies
run: yarn && yarn build
# If your firebase cloud functions project uses firebase-admin
# you need to create a config file used to initialize your project
# the below task creates a config.json file in your functions directory
- name: create config json
uses: jsdaniell/create-json@1.1.2
id: create-config-json
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: yarn
- name: Build
run: yarn build
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: 'config.json'
json: '{"type": "${{ secrets.TYPE }}","auth_uri": "${{ secrets.AUTH_URI }}","auth_provider_x509_cert_url": "${{ secrets.AUTH_PROVIDER_X509_CERT_URL }}","private_key_id": "${{ secrets.PRIVATE_KEY_ID }}","project_id": "${{ secrets.PROJECT_ID }}","private_key": "${{ secrets.PRIVATE_KEY }}","token_uri": "${{ secrets.TOKEN_URI }}", "client_email": "${{ secrets.CLIENT_EMAIL }}","client_x509_cert_url": "${{ secrets.CLIENT_X509_CERT_URL }}","client_id": "${{ secrets.CLIENT_ID }}"}'
dir: '.'
# The below task uses the w9jds/firebase-action@master action with the appropriate argument
# to deploy your firebase cloud functions.
- name: deploy to production
name: dist
path: dist
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: dist
path: dist
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only functions
Expand Down

0 comments on commit 489cc79

Please sign in to comment.