Skip to content

Commit 4c8bb59

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 4c8bb59

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.github/workflows/checkSite.yml

Lines changed: 5 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,9 @@ 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: npm i && npm run lint
43+
working-directory: firebase/functions
3944
- name: Install Site Checker
4045
run: yarn install
4146
working-directory: href-checker

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ jobs:
3232
run: make site-run-server
3333
- name: Generate sitemap
3434
run: make site-map
35+
- name: Deploy firebase functions
36+
run: npm i && npm run deploy
37+
env:
38+
FIREBASE_TOKEN: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_KPT_DEV }}"
39+
working-directory: firebase/functions
3540
- uses: FirebaseExtended/action-hosting-deploy@276388dd6c2cde23455b30293105cc866c22282d # v0
3641
with:
3742
repoToken: "${{ secrets.GITHUB_TOKEN }}"

firebase/functions/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"devDependencies": {
2121
"eslint": "^7.6.0",
2222
"eslint-config-google": "^0.14.0",
23-
"firebase-functions-test": "^0.2.0"
23+
"firebase-functions-test": "^0.2.0",
24+
"firebase-tools": "^10.4.0"
2425
},
2526
"private": true
2627
}

0 commit comments

Comments
 (0)