Skip to content

Commit d86980f

Browse files
committed
work-for-beta
1 parent 6c2e5e5 commit d86980f

23 files changed

Lines changed: 82 additions & 27 deletions

.firebaserc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"projects": {
3-
"default": "parallel-cf800",
4-
"prod": "parallel-cf800",
3+
"default": "parallel-beta-31dc4",
4+
"prod": "parallel-beta-31dc4",
55
"beta": "parallel-beta-31dc4"
66
}
77
}

.github/workflows/beta.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy Beta
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [edited]
7+
8+
jobs:
9+
deploy-beta:
10+
name: Deploy
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Use Node.js version from .nvmrc
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version-file: .nvmrc
20+
21+
- name: Write service account
22+
run: |
23+
mkdir private
24+
echo "$BETA_FIREBASE_SERVICE_ACCOUNT" > ./private/service-account.json
25+
echo '${{ secrets.BETA_FIREBASE_SERVICE_ACCOUNT }}' > gcloud.json
26+
env:
27+
BETA_FIREBASE_SERVICE_ACCOUNT: ${{ secrets.BETA_FIREBASE_SERVICE_ACCOUNT }}
28+
shell: bash
29+
30+
- name: Install
31+
run: |
32+
npm install
33+
shell: bash
34+
35+
- name: Deploy
36+
env:
37+
GOOGLE_APPLICATION_CREDENTIALS: gcloud.json
38+
run: |
39+
npm run deploy
40+
shell: bash

functions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
const firebase = require('firebase-admin');
77
firebase.initializeApp({
88
credential: firebase.credential.cert(require('./build/service-account.json')),
9-
databaseURL: `https://parallel-cf800.firebaseio.com`,
9+
databaseURL: `https://parallel-beta-31dc4.firebaseio.com`,
1010
});
1111

1212
const fs = require('fs');

functions/views/_layout.pug

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ html
3636

3737
body
3838
#vue
39+
.beta
40+
div You are on our Beta Testing Site!
41+
div The information & events on this page are for testing purposes and should not be followed.
42+
a(href="https://parallel.org.uk") Click here to return to the production site.
3943
.headerWrapper
4044
.header
4145
if !sidebarDisabled

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
},
99
"scripts": {
1010
"start": "grunt build && npm run serve",
11-
"serve": "grunt concurrent & GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase serve --project prod",
12-
"export-users": "cross-env GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase auth:export ./private/tmp-users.json --format=json --project prod",
13-
"deploy": "grunt && GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase deploy --project prod",
11+
"serve": "grunt concurrent & GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase serve --project beta",
12+
"export-users": "cross-env GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase auth:export ./private/tmp-users.json --format=json --project beta",
13+
"deploy": "grunt && GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase deploy --project beta",
1414
"convert-teachers": "node scripts/convert-teachers.js",
1515
"convert-students": "node scripts/convert-students.js",
1616
"get-users": "node scripts/get-users.js",
@@ -20,7 +20,7 @@
2020
"get-tts-results": "node scripts/get-tts-results.js",
2121
"update-results": "node scripts/update-results.js",
2222
"set-points": "node scripts/set-points.js",
23-
"start-marsh": "grunt build && concurrently \"grunt concurrent\" \"GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase serve --project prod\""
23+
"start-marsh": "grunt build && concurrently \"grunt concurrent\" \"GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase serve --project beta\""
2424
},
2525
"devDependencies": {
2626
"@babel/core": "^7.15.0",

pages/troubleshooting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
In order for pupils to receive the weekly email reminder to take part in the latest Parallelograms and successfully manage their account and password, you may need your school's IT department to whitelist the following addresses:
66

7-
* noreply@parallel-cf800.firebaseapp.com
8-
* https://parallel-cf800.firebaseapp.com
7+
* noreply@parallel-beta-31dc4.firebaseapp.com
8+
* https://parallel-beta-31dc4.firebaseapp.com
99
* contact@parallel.org.uk
1010
* https://parallel.org.uk/
1111

scripts/change-email.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const to = 'lalanthi026@googlemail.com'
88

99
fb.initializeApp({
1010
credential: fb.credential.cert(serviceAccount),
11-
databaseURL: "https://parallel-cf800.firebaseio.com",
11+
databaseURL: "https://parallel-beta-31dc4.firebaseio.com",
1212
});
1313

1414
const run = () =>

scripts/convert-students.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const STUDENTS = [
99

1010
fb.initializeApp({
1111
credential: fb.credential.cert(serviceAccount),
12-
databaseURL: 'https://parallel-cf800.firebaseio.com'
12+
databaseURL: 'https://parallel-beta-31dc4.firebaseio.com'
1313
});
1414

1515
const file = path.join(__dirname, `../private/tmp-users.json`);

scripts/convert-teachers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const TEACHERS = [
1010

1111
fb.initializeApp({
1212
credential: fb.credential.cert(serviceAccount),
13-
databaseURL: 'https://parallel-cf800.firebaseio.com'
13+
databaseURL: 'https://parallel-beta-31dc4.firebaseio.com'
1414
});
1515

1616
const file = path.join(__dirname, `../private/tmp-users.json`);

scripts/delete-accounts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const USERS = [
77

88
fb.initializeApp({
99
credential: fb.credential.cert(serviceAccount),
10-
databaseURL: 'https://parallel-cf800.firebaseio.com'
10+
databaseURL: 'https://parallel-beta-31dc4.firebaseio.com'
1111
});
1212

1313
async function deleteAccount(email) {

0 commit comments

Comments
 (0)