File tree 5 files changed +115
-53
lines changed
5 files changed +115
-53
lines changed Original file line number Diff line number Diff line change 9
9
branches :
10
10
- main
11
11
jobs :
12
- ci_backend :
12
+ lint :
13
+ name : Lint
13
14
runs-on : ubuntu-latest
14
15
defaults :
15
16
run :
31
32
run : npm ci --ignore-scripts --no-audit --no-progress
32
33
- name : Lint
33
34
run : npm run lint
35
+ build :
36
+ name : Build
37
+ runs-on : ubuntu-latest
38
+ defaults :
39
+ run :
40
+ working-directory : ./functions
41
+ steps :
42
+ - uses : actions/checkout@v2
43
+ - name : Setup Node.js
44
+ uses : actions/setup-node@v1
45
+ with :
46
+ node-version : 12
47
+ - name : Cache npm dependencies
48
+ uses : actions/cache@v1
49
+ with :
50
+ key : npm-${{ hashFiles('package-lock.json') }}
51
+ path : ~/.npm
52
+ restore-keys : |
53
+ npm-
54
+ - name : Install dependencies
55
+ run : npm ci --ignore-scripts --no-audit --no-progress
34
56
- name : Build
35
57
run : npm run build
58
+ - name : Share artifact inside workflow
59
+ uses : actions/upload-artifact@v2
60
+ with :
61
+ name : functions-build
62
+ path : functions/lib
63
+ deploy :
64
+ name : Deploy to Firebase Cloud Functions (Staging)
65
+ if : github.ref == 'refs/heads/main'
66
+ runs-on : ubuntu-latest
67
+ needs : [ lint, build ]
68
+ environment : staging
69
+ defaults :
70
+ run :
71
+ working-directory : ./functions
72
+ steps :
73
+ - uses : actions/checkout@v2
74
+ - name : Setup Node.js
75
+ uses : actions/setup-node@v1
76
+ with :
77
+ node-version : 12
78
+ - name : Cache npm dependencies
79
+ uses : actions/cache@v1
80
+ with :
81
+ key : npm-${{ hashFiles('package-lock.json') }}
82
+ path : ~/.npm
83
+ restore-keys : |
84
+ npm-
85
+ - name : Install dependencies
86
+ run : npm ci --ignore-scripts --no-audit --no-progress
87
+ - name : Get artifact
88
+ uses : actions/download-artifact@v2
89
+ with :
90
+ name : functions-build
91
+ path : functions/lib
92
+ - name : Install Firebase CLI
93
+ run : npm install -g firebase-tools
94
+ - name : Deploy to Firebase Cloud Functions
95
+ run : firebase deploy --only functions
96
+ env :
97
+ FIREBASE_TOKEN : ${{ secrets.FIREBASE_TOKEN }}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 12
12
branches :
13
13
- main
14
14
jobs :
15
- ci_frontend :
15
+ lint :
16
+ name : Lint
16
17
runs-on : ubuntu-latest
17
18
steps :
18
19
- uses : actions/checkout@v2
31
32
run : npm ci --ignore-scripts --no-audit --no-progress
32
33
- name : Lint
33
34
run : npm run lint
35
+ build :
36
+ name : Build
37
+ runs-on : ubuntu-latest
38
+ steps :
39
+ - uses : actions/checkout@v2
40
+ - name : Setup Node.js
41
+ uses : actions/setup-node@v1
42
+ with :
43
+ node-version : 12
44
+ - name : Cache npm dependencies
45
+ uses : actions/cache@v1
46
+ with :
47
+ key : npm-${{ hashFiles('package-lock.json') }}
48
+ path : ~/.npm
49
+ restore-keys : |
50
+ npm-
51
+ - name : Install dependencies
52
+ run : npm ci --ignore-scripts --no-audit --no-progress
34
53
- name : Build
35
54
run : npm run build
55
+ - name : Share artifact inside workflow
56
+ uses : actions/upload-artifact@v2
57
+ with :
58
+ name : create-react-app-build
59
+ path : build
60
+ deploy :
61
+ name : Deploy to Firebase Hosting (Staging)
62
+ if : github.ref == 'refs/heads/main'
63
+ runs-on : ubuntu-latest
64
+ needs : [ lint, build ]
65
+ environment : staging
66
+ steps :
67
+ - uses : actions/checkout@v2
68
+ - name : Get artifact
69
+ uses : actions/download-artifact@v2
70
+ with :
71
+ name : create-react-app-build
72
+ path : build
73
+ - name : Deploy to Firebase Hosting
74
+ uses : FirebaseExtended/action-hosting-deploy@v0
75
+ with :
76
+ repoToken : " ${{ secrets.GITHUB_TOKEN }}"
77
+ firebaseServiceAccount : " ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
78
+ channelId : live
79
+ projectId : staging-clockwork
36
80
Original file line number Diff line number Diff line change 3
3
"rules" : " firestore.rules" ,
4
4
"indexes" : " firestore.indexes.json"
5
5
},
6
- "functions" : {
7
- "predeploy" : [
8
- " npm --prefix \" $RESOURCE_DIR\" run lint" ,
9
- " npm --prefix \" $RESOURCE_DIR\" run build"
10
- ]
11
- },
12
6
"hosting" : {
13
7
"public" : " build" ,
14
8
"ignore" : [
Original file line number Diff line number Diff line change @@ -50,11 +50,13 @@ export class SectionsService {
50
50
. doc ( SectionsService . constructSectionKey ( term , subject , code ) )
51
51
. get ( ) ;
52
52
53
- const t = doc . data ( ) ?. retrievedAt ?. getTime ( ) ;
54
- // if retrievedAt exists and it wasn't retieved within 30 minutes
55
- if ( t && t + 1000 * 1800 > Date . now ( ) ) {
56
- return undefined ;
57
- }
53
+ // FIX: serialization to and from firestore isn't working as expected
54
+ // disable document staleness check for now.
55
+ // const t = doc.data()?.retrievedAt?.getTime();
56
+ // // if retrievedAt exists and it wasn't retieved within 30 minutes
57
+ // if (t && t + 1000 * 1800 > Date.now()) {
58
+ // return undefined;
59
+ // }
58
60
return doc . data ( ) ;
59
61
}
60
62
You can’t perform that action at this time.
0 commit comments