Script - npm run db:populate #59
Workflow file for this run
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: Script - npm run db:populate | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: Application environment to execute in. | |
required: true | |
term: | |
description: Academic term to execute descript with. ie 202009, 202001 | |
required: true | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./functions | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- name: Cache npm dependencies | |
uses: actions/cache@v2 | |
with: | |
key: npm-${{ hashFiles('package-lock.json') }} | |
path: ~/.npm | |
restore-keys: | | |
npm- | |
- name: Install dependencies | |
run: npm ci --ignore-scripts --no-audit --no-progress | |
- name: Lint | |
run: npm run lint | |
npm-run: | |
name: Execute Script | |
needs: [lint] | |
runs-on: ubuntu-latest | |
environment: ${{ github.event.inputs.environment }} | |
defaults: | |
run: | |
working-directory: ./functions | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- name: Cache npm dependencies | |
uses: actions/cache@v2 | |
with: | |
key: npm-${{ hashFiles('package-lock.json') }} | |
path: ~/.npm | |
restore-keys: | | |
npm- | |
- name: Install dependencies | |
run: npm ci --ignore-scripts --no-audit --no-progress | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v0 | |
with: | |
service_account_key: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }} | |
export_default_credentials: true | |
- name: Execute Script | |
run: npm run db:populate ${{ github.event.inputs.term }} |