Skip to content

Commit 9de71e3

Browse files
committed
ci: add step to deploy firebase functions on merge
This change is intended to automatically deploy firebase functions in addition to the already deployed hosted content on merge.
1 parent db64b2f commit 9de71e3

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

.github/workflows/checkSite.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ on:
1717
pull_request:
1818
paths:
1919
- "site/**"
20+
- "firebase/**"
2021
push:
2122
paths:
2223
- "site/**"
24+
- "firebase/**"
2325
jobs:
2426
build:
2527
runs-on: ubuntu-latest
@@ -36,6 +38,8 @@ jobs:
3638
- name: Lint site content
3739
run: npm i && npm run lint-check
3840
working-directory: site
41+
- name: Lint firebase functions
42+
run: make site-functions-lint
3943
- name: Install Site Checker
4044
run: yarn install
4145
working-directory: href-checker

.github/workflows/firebase-hosting-merge.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@ jobs:
2828
- uses: actions/setup-node@v2
2929
with:
3030
node-version: '16'
31+
- name : Install firebase-tools
32+
run: npm install -g firebase-tools
3133
- name: Generate Site
3234
run: make site-run-server
3335
- name: Generate sitemap
3436
run: make site-map
37+
- name: Deploy firebase functions
38+
run: make site-deploy-functions
39+
env:
40+
FIREBASE_TOKEN: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_KPT_DEV }}"
3541
- uses: FirebaseExtended/action-hosting-deploy@276388dd6c2cde23455b30293105cc866c22282d # v0
3642
with:
3743
repoToken: "${{ secrets.GITHUB_TOKEN }}"

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,9 @@ site-check:
116116

117117
site-verify-examples:
118118
./scripts/verifyExamples.sh
119+
120+
site-functions-deploy:
121+
npm run --prefix=firebase/functions deploy
122+
123+
site-functions-lint:
124+
npm run --prefix=firebase/functions lint

0 commit comments

Comments
 (0)