Skip to content

Commit daad774

Browse files
Add Firebase configuration and hosting setup files
1 parent 98b0de2 commit daad774

7 files changed

Lines changed: 141 additions & 48 deletions

File tree

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "minipay-tic-tac-toe"
4+
}
5+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This file was auto-generated by the Firebase CLI
2+
# https://github.com/firebase/firebase-tools
3+
4+
name: Deploy to Firebase Hosting on merge
5+
on:
6+
push:
7+
branches:
8+
- main
9+
jobs:
10+
build_and_deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '22'
19+
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v4
22+
with:
23+
version: 10.12.1
24+
cache: true
25+
26+
- name: Install dependencies
27+
run: pnpm install --frozen-lockfile
28+
29+
- name: CI
30+
run: pnpm run ci
31+
- uses: FirebaseExtended/action-hosting-deploy@v0
32+
with:
33+
repoToken: ${{ secrets.GITHUB_TOKEN }}
34+
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_MINIPAY_TIC_TAC_TOE }}
35+
channelId: live
36+
projectId: minipay-tic-tac-toe
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This file was auto-generated by the Firebase CLI
2+
# https://github.com/firebase/firebase-tools
3+
4+
name: Deploy to Firebase Hosting on PR
5+
on: pull_request
6+
permissions:
7+
checks: write
8+
contents: read
9+
pull-requests: write
10+
jobs:
11+
build_and_preview:
12+
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '22'
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
with:
25+
version: 10.12.1
26+
cache: true
27+
28+
- name: Install dependencies
29+
run: pnpm install --frozen-lockfile
30+
31+
- name: CI
32+
run: pnpm run ci
33+
- uses: FirebaseExtended/action-hosting-deploy@v0
34+
with:
35+
repoToken: ${{ secrets.GITHUB_TOKEN }}
36+
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_MINIPAY_TIC_TAC_TOE }}
37+
projectId: minipay-tic-tac-toe

app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@tailwindcss/vite": "4.1.16",
2727
"@tanstack/react-query-devtools": "5.87.4",
2828
"@trivago/prettier-plugin-sort-imports": "6.0.2",
29+
"@types/node": "22.0.0",
2930
"@types/react": "19.1.2",
3031
"@types/react-dom": "19.1.2",
3132
"@vitejs/plugin-react": "5.1.2",

firebase.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"hosting": {
3+
"public": "app/dist",
4+
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
5+
"rewrites": [
6+
{
7+
"source": "**",
8+
"destination": "/index.html"
9+
}
10+
]
11+
}
12+
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
"type": "module",
55
"scripts": {
66
"dev": "pnpm --filter @tic-tac-toe/app dev",
7-
"build": "pnpm --filter @tic-tac-toe/contract compile && pnpm --filter @tic-tac-toe/app compile",
7+
"build": "pnpm --filter @tic-tac-toe/contract compile && pnpm --filter @tic-tac-toe/app build",
88
"test": "pnpm --filter @tic-tac-toe/contract test && pnpm --filter @tic-tac-toe/app test",
99
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
1010
"format": "prettier --write .",
11-
"prepare": "husky"
11+
"prepare": "husky",
12+
"ci": "pnpm test && pnpm lint && pnpm format && pnpm build"
1213
},
1314
"lint-staged": {
1415
"*": "prettier --write --ignore-unknown",

0 commit comments

Comments
 (0)