Skip to content

Commit 0a3421f

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 be8790b commit 0a3421f

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-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
@@ -38,6 +40,9 @@ jobs:
3840
- name: Lint site content
3941
run: npm i && npm run lint-check
4042
working-directory: site
43+
- name: Lint firebase functions
44+
run: npm i && npm run lint
45+
working-directory: firebase/functions
4146
# - name: Install Site Checker
4247
# run: yarn install
4348
# working-directory: href-checker
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Deploy to Firebase Functions on merge
16+
on:
17+
push:
18+
branches:
19+
- main
20+
paths:
21+
- "firebase/**"
22+
jobs:
23+
build_and_deploy:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
- uses: actions/setup-node@v2
28+
with:
29+
node-version: '16'
30+
- name: Deploy firebase functions
31+
run: |
32+
npm install -g firebase-tools
33+
firebase deploy --only functions
34+
env:
35+
FIREBASE_TOKEN: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_KPT_DEV }}"

firebase/functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"serve": "firebase emulators:start --only functions",
77
"shell": "firebase functions:shell",
88
"start": "npm run shell",
9-
"deploy": "firebase deploy --only functions",
9+
"deploy": "firebase deploy --only functions --config ../../firebase.json",
1010
"logs": "firebase functions:log"
1111
},
1212
"engines": {

0 commit comments

Comments
 (0)