Skip to content

Commit 7d8a556

Browse files
authored
Implement CI (#2)
* Adds CI/CD workflow for Firebase deployment Sets up a GitHub Actions workflow to automate the deployment process to Firebase. This includes: - Checking out the code - Setting up Node.js with caching for npm dependencies in both client and functions directories - Installing and building the client application - Installing and building the Firebase functions - Deploying the application to Firebase using the provided token and project ID. * CI on pull-request, just to test * Configure lint * Fix lint * Fix deploy * Remove run on pull requests
1 parent bb1cb6f commit 7d8a556

File tree

21 files changed

+1638
-1060
lines changed

21 files changed

+1638
-1060
lines changed
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
robots.txt,1747246108219,391d14b3c2f8c9143a27a28c7399585142228d4d1bdbe2c87ac946de411fa9a2
2-
index.html,1747246114355,87fd6bfac60dee440f0cb8af687289398e6fe8c7b6ad32f02d154f3a369bb2ec
3-
favicon.ico,1747246108217,1463be9bedc82e16f9364eec7a1f5152cbe56229401381eed65c1496cb884407
4-
asset-manifest.json,1747246114355,18da15dabf1037e1075484219656c20d75f3c507485fb9e149d5b1387e0b63ac
5-
logo192.png,1747246108218,f66564670b5bfe49f3f04a5b63107bae60f4a7736f1d3b83aa0115f7acf45150
6-
manifest.json,1747246108219,4e1d3adad9ce7e17c0d13fac197f1c27091906f4ecf3909c9f51247bff345118
7-
logo512.png,1747246108218,2356e0b814e58a349935c8de17226873d615d088a867d591fef48a64c80c9a2f
8-
static/css/main.e6c13ad2.css.map,1747246114358,cc301afafc706597c201efb487db6e60f84d27f49828b760f0c3f3a28f314c28
9-
static/js/main.dbda0a9b.js.LICENSE.txt,1747246114358,953291b77e047a1b687918f78bb8d5e31b0776777b4e47fb89377bb6466f43cc
10-
static/css/main.e6c13ad2.css,1747246114358,7dc117daa25a4309dbab4c1304a676f1531a2a3d680260e1107371912f928473
11-
static/js/317.043961de.chunk.js,1747246114358,477e7994487d450c11f8c5be8cf99bfb7a3d484ee40e87322579d9c8ef1b752a
12-
img/balancer.png,1747246108218,a19093e604ba90a8d60799ca70258cb0c18fba56a4e63d7e57b9d2553ab774fe
13-
static/js/317.043961de.chunk.js.map,1747246114358,32d51e756d0c2daa82d6ac4917e8d0611cdc5d6ca630c15f481079735aa6fc07
14-
static/js/main.dbda0a9b.js,1747246114358,e84f01e13f0db49ba889f5c7f53c5963d406ab5ef1709bba56e8f44a3caab492
15-
static/js/main.dbda0a9b.js.map,1747246114358,e5dc2f238cee1a6b6e61d3f4a146eea851a225ac53bcb3270fa00bcfa1446aeb
1+
robots.txt,1751635541172,391d14b3c2f8c9143a27a28c7399585142228d4d1bdbe2c87ac946de411fa9a2
2+
logo192.png,1751635541171,f66564670b5bfe49f3f04a5b63107bae60f4a7736f1d3b83aa0115f7acf45150
3+
logo512.png,1751635541171,2356e0b814e58a349935c8de17226873d615d088a867d591fef48a64c80c9a2f
4+
asset-manifest.json,1751635550736,2814afb29715989d10a7e069f1b97163d22034fc02308f466051c6da41864ac2
5+
static/js/main.f3b0041a.js.LICENSE.txt,1751635550739,953291b77e047a1b687918f78bb8d5e31b0776777b4e47fb89377bb6466f43cc
6+
favicon.ico,1751635541170,1463be9bedc82e16f9364eec7a1f5152cbe56229401381eed65c1496cb884407
7+
static/js/317.043961de.chunk.js,1751635550740,477e7994487d450c11f8c5be8cf99bfb7a3d484ee40e87322579d9c8ef1b752a
8+
index.html,1751635550736,1e30f7262e878e6c5e8f06c5550899b9aeb85b1bc5cbd38eee27dfe2e041312e
9+
static/css/main.a4a2ec6e.css.map,1751635550739,8434d9b8cfc0ce084e0ac2f8018740d01347170fbc68f9de8a8b28b0437e71cb
10+
static/css/main.a4a2ec6e.css,1751635550739,1c6f6404f04d72d208467e78db2a37a25d5f28be5dd177bab7a5dabf3620e50a
11+
manifest.json,1751635541171,4e1d3adad9ce7e17c0d13fac197f1c27091906f4ecf3909c9f51247bff345118
12+
img/balancer.png,1751635541171,a19093e604ba90a8d60799ca70258cb0c18fba56a4e63d7e57b9d2553ab774fe
13+
static/js/317.043961de.chunk.js.map,1751635550739,32d51e756d0c2daa82d6ac4917e8d0611cdc5d6ca630c15f481079735aa6fc07
14+
static/js/main.f3b0041a.js,1751635550740,932800711ce5d1abe4ba0e02e52853fe51889ef45af59e59277ef35f69e9781d
15+
static/js/main.f3b0041a.js.map,1751635550740,b66e011edbf9904b9385ab782167eb6f241f58b4d5468d6d68c576740f791844

.github/workflows/deploy.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy to Firebase
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version-file: ".nvmrc"
19+
cache: "npm"
20+
cache-dependency-path: |
21+
client/package-lock.json
22+
functions/package-lock.json
23+
24+
- name: Install client dependencies
25+
working-directory: ./client
26+
run: npm ci
27+
28+
- name: Build client
29+
working-directory: ./client
30+
run: npm run build
31+
32+
- name: Install functions dependencies
33+
working-directory: ./functions
34+
run: npm ci
35+
36+
- name: Build functions
37+
working-directory: ./functions
38+
run: npm run build
39+
40+
- name: Install Firebase CLI
41+
run: npm install -g firebase-tools
42+
43+
- name: Deploy to Firebase
44+
run: firebase deploy --token "${{ secrets.FIREBASE_TOKEN }}"
45+
env:
46+
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}

client/.eslintrc.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2021: true,
6+
node: true,
7+
},
8+
extends: ['react-app', 'react-app/jest', 'prettier'],
9+
plugins: ['prettier'],
10+
rules: {
11+
'prettier/prettier': 'error',
12+
'no-console': 'warn',
13+
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
14+
'react-hooks/exhaustive-deps': 'off',
15+
},
16+
ignorePatterns: ['build/', 'node_modules/', '*.config.js'],
17+
};

client/.prettierignore

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build outputs
5+
build/
6+
dist/
7+
8+
# Environment files
9+
.env
10+
.env.local
11+
.env.development.local
12+
.env.test.local
13+
.env.production.local
14+
15+
# Logs
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*
19+
20+
# Runtime data
21+
pids
22+
*.pid
23+
*.seed
24+
*.pid.lock
25+
26+
# Coverage directory used by tools like istanbul
27+
coverage/
28+
29+
# nyc test coverage
30+
.nyc_output
31+
32+
# Dependency directories
33+
jspm_packages/
34+
35+
# Optional npm cache directory
36+
.npm
37+
38+
# Optional REPL history
39+
.node_repl_history
40+
41+
# Output of 'npm pack'
42+
*.tgz
43+
44+
# Yarn Integrity file
45+
.yarn-integrity
46+
47+
# dotenv environment variables file
48+
.env
49+
50+
# parcel-bundler cache (https://parceljs.org/)
51+
.cache
52+
.parcel-cache
53+
54+
# next.js build output
55+
.next
56+
57+
# nuxt.js build output
58+
.nuxt
59+
60+
# vuepress build output
61+
.vuepress/dist
62+
63+
# Serverless directories
64+
.serverless
65+
66+
# FuseBox cache
67+
.fusebox/
68+
69+
# DynamoDB Local files
70+
.dynamodb/
71+
72+
# TernJS port file
73+
.tern-port
74+
75+
# Package lock files
76+
package-lock.json
77+
yarn.lock
78+
79+
# TypeScript declaration files
80+
*.d.ts
81+
82+
# Generated files
83+
*.generated.*

client/.prettierrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"bracketSpacing": true,
9+
"bracketSameLine": false,
10+
"arrowParens": "avoid",
11+
"endOfLine": "lf",
12+
"jsxSingleQuote": true,
13+
"quoteProps": "as-needed"
14+
}

client/.vscode/settings.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll.eslint": "explicit"
6+
},
7+
"[typescript]": {
8+
"editor.defaultFormatter": "esbenp.prettier-vscode"
9+
},
10+
"[typescriptreact]": {
11+
"editor.defaultFormatter": "esbenp.prettier-vscode"
12+
},
13+
"[javascript]": {
14+
"editor.defaultFormatter": "esbenp.prettier-vscode"
15+
},
16+
"[javascriptreact]": {
17+
"editor.defaultFormatter": "esbenp.prettier-vscode"
18+
},
19+
"[json]": {
20+
"editor.defaultFormatter": "esbenp.prettier-vscode"
21+
},
22+
"[css]": {
23+
"editor.defaultFormatter": "esbenp.prettier-vscode"
24+
},
25+
"[markdown]": {
26+
"editor.defaultFormatter": "esbenp.prettier-vscode"
27+
},
28+
"eslint.validate": [
29+
"javascript",
30+
"javascriptreact",
31+
"typescript",
32+
"typescriptreact"
33+
]
34+
}

0 commit comments

Comments
 (0)