pashto-dictionary/.github/workflows/functions-ci.yml

44 lines
1.1 KiB
YAML
Raw Normal View History

2024-08-14 19:30:10 +00:00
name: Functions CI
on:
push:
branches:
- master
paths:
- "functions/**"
- ".github/workflows/functions-ci.yml"
workflow_dispatch:
jobs:
build-and-serve-functions:
runs-on: ubuntu-latest
env:
LINGDOCS_NPM_TOKEN: ${{ secrets.LINGDOCS_NPM_TOKEN }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm install -g firebase-tools
- name: build functions
run: |
cp .npmrc functions
cd website
npm install
cd ..
cd functions
npm install
npm run build
- name: start up emulator once
run: |
cd functions
firebase functions:config:get --token ${FIREBASE_TOKEN} > .runtimeconfig.json
echo '#!/bin/bash' > empty.sh
chmod +x empty.sh
firebase emulators:exec ./empty.sh --only functions --token ${FIREBASE_TOKEN}
rm .runtimeconfig.json
rm empty.sh