Skip to content

Commit 9e9bed6

Browse files
authored
chore(firebase): github actions for deployment (nodejs#2846)
1 parent ed84e1c commit 9e9bed6

8 files changed

Lines changed: 59 additions & 18 deletions

File tree

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ module.exports = {
5656
env: { jest: true, node: true, browser: true },
5757
},
5858
{
59-
// Disable linting for API as some parts are just not compatible with MDXv2
6059
files: ['content/**/*.{md,mdx}'],
6160
extends: ['plugin:mdx/recommended'],
6261
settings: { 'mdx/code-blocks': false },

.firebaserc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"projects": {
3-
"staging": "nodejs-infrastructure"
3+
"staging": "nodejs-infrastructure",
4+
"default": "nodejs-infrastructure"
45
},
56
"targets": {
67
"nodejs-infrastructure": {
@@ -11,4 +12,4 @@
1112
}
1213
}
1314
}
14-
}
15+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy to Firebase Production
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build_and_deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Git Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version-file: '.nvmrc'
19+
cache: 'npm'
20+
21+
- name: Gatsby Cache Folder
22+
uses: actions/cache@v3
23+
with:
24+
key: cache-folder-ubuntu-latest
25+
path: .cache
26+
27+
- name: Gatsby Public Folder
28+
uses: actions/cache@v3
29+
with:
30+
key: public-folder-ubuntu-latest
31+
path: public
32+
33+
- name: Build Gatsby
34+
run: npm run build-ci
35+
36+
- uses: FirebaseExtended/action-hosting-deploy@v0
37+
with:
38+
repoToken: '${{ secrets.GITHUB_TOKEN }}'
39+
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_NODEJS_INFRASTRUCTURE }}'
40+
channelId: live
41+
projectId: nodejs-infrastructure

.github/workflows/github-pages.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: Build and Deploy to GitHub Pages
33
on:
44
push:
55
branches:
6-
- main
7-
# Allow workflow to be called manually
6+
- main
87
workflow_dispatch:
98

109
jobs:
@@ -13,7 +12,6 @@ jobs:
1312
contents: read
1413
pages: read
1514
runs-on: ubuntu-latest
16-
1715
steps:
1816
- name: Git Checkout
1917
uses: actions/checkout@v3
@@ -35,13 +33,13 @@ jobs:
3533
- name: Gatsby Cache Folder
3634
uses: actions/cache@v3
3735
with:
38-
key: cache-folder
36+
key: cache-folder-ubuntu-latest
3937
path: .cache
4038

4139
- name: Gatsby Public Folder
4240
uses: actions/cache@v3
4341
with:
44-
key: public-folder
42+
key: public-folder-ubuntu-latest
4543
path: public
4644

4745
- name: Build Gatsby

.github/workflows/pull-request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929

3030
- name: Upload Code Coverage
3131
uses: codecov/codecov-action@v3
32+
3233
build-ci:
3334
needs: test-ci
3435
name: Node on ${{ matrix.os }}
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Close inactive Issues/PRs
2+
23
on:
34
schedule:
4-
- cron: "30 1 * * *"
5+
- cron: '30 1 * * *'
6+
57
jobs:
68
close-issues:
79
runs-on: ubuntu-latest
@@ -13,14 +15,14 @@ jobs:
1315
with:
1416
days-before-issue-stale: 60
1517
days-before-issue-close: 14
16-
stale-issue-label: "stale"
17-
stale-pr-label: "stale"
18-
stale-issue-message: "This issue is stale because it has been open for 60 days with no activity."
19-
stale-pr-message: "This pull request is stale because it has been open for 30 days with no activity."
20-
close-issue-message: "This isseue was closed because it has been inactive for 14 days since being marked as stale."
21-
close-pr-message: "This pull request was closed because it has been inactive for 14 days since being marked as stale."
18+
stale-issue-label: 'stale'
19+
stale-pr-label: 'stale'
20+
stale-issue-message: 'This issue is stale because it has been open for 60 days with no activity.'
21+
stale-pr-message: 'This pull request is stale because it has been open for 30 days with no activity.'
22+
close-issue-message: 'This isseue was closed because it has been inactive for 14 days since being marked as stale.'
23+
close-pr-message: 'This pull request was closed because it has been inactive for 14 days since being marked as stale.'
2224
days-before-pr-stale: 30
2325
days-before-pr-close: 14
2426
exempt-draft-pr: true
25-
exempt-issue-labels: "discussion,enhancement,bug,good first issue,help wanted,docs"
27+
exempt-issue-labels: 'discussion,enhancement,bug,good first issue,help wanted,docs'
2628
repo-token: ${{ secrets.GITHUB_TOKEN }}

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.cache/
2-
.github/
32
.history/
43
public/
54
coverage/

firebase.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,4 +557,4 @@
557557
"type": "301"
558558
}
559559
]
560-
}
560+
}

0 commit comments

Comments
 (0)