Layout fixes for messaging pdf attachments #22
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 develop branch | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- master | |
jobs: | |
build-and-deploy-functions: | |
name: Build and Deploy Functions | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source Code | |
uses: actions/checkout@v2-beta | |
with: | |
ref: master | |
- name: get changed functions | |
id: changed-functions | |
uses: tj-actions/changed-files@v14.2 | |
with: | |
base_sha: ${{github.event.pull_request.base.sha}} | |
files: | | |
functions/*/ | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: NPM Install Functions | |
working-directory: ./functions | |
run: | | |
npm install | |
env: | |
CXXFLAGS: -Wno-error | |
- name: set environment variables | |
uses: w9jds/firebase-action@master | |
with: | |
args: 'functions:config:set env.bq_project=cqrefpwa env.bq_dataset=observations' | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_DEPLOY_KEY }} | |
PROJECT_ID: cqrefpwa | |
- name: get changed functions | |
run: | | |
echo "CHANGED_OUTPUT=$(echo "${{steps.changed-functions.outputs.all_changed_files}}" | sed 's/functions\/\([[:alpha:]]\+\)\/index.js/\1/g' | sed 's/\([[:alpha:]]\+\)[[:space:]]\?/functions:\1,/g')" >> $GITHUB_ENV | |
- name: prepare deploy string | |
run: | | |
echo $CHANGED_OUTPUT | |
- name: Deploy Functions on Prod Server | |
uses: w9jds/firebase-action@master | |
if: steps.changed-functions.outputs.any_changed == 'true' | |
with: | |
args: deploy --only ${{env.CHANGED_OUTPUT}} | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_DEPLOY_KEY }} | |
PROJECT_PATH: ./functions | |
PROJECT_ID: cqrefpwa | |
build-and-deploy-fe: | |
name: Build and Deploy Frontend | |
runs-on: ubuntu-latest | |
steps: | |
- name: Assign Author | |
uses: technote-space/assign-author@v1.2.4 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout Source Code | |
uses: actions/checkout@v2-beta | |
with: | |
ref: master | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: NPM Install and Build Frontend | |
working-directory: ./ | |
run: | | |
yarn install | |
yarn run removebuild | |
yarn run prod | |
env: | |
CXXFLAGS: -Wno-error | |
- name: Deploy on Prod Server | |
uses: w9jds/firebase-action@master | |
with: | |
args: "deploy --only hosting:cqrefpwa" | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_DEPLOY_KEY }} | |
PROJECT_ID: default |