Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "castingthreejs"
}
}
35 changes: 35 additions & 0 deletions .github/workflows/firebase-hosting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy to Firebase Hosting

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build_and_deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Deploy to Firebase Hosting
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CASTINGTHREEJS }}
projectId: castingthreejs
channelId: live
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ dist
# Docusaurus cache and generated files
.docusaurus

# Firebase local state and logs
.firebase/
firebase-debug.log*

# Serverless directories
.serverless/

Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ the looping idle, with `character.castBlendIn` / `castBlendOut` as the two edges
The HDR is loaded as image-based lighting and as the reflection source for the ice — it is never
shown as a visible sky. The stage keeps its flat dark backdrop.

## Firebase Hosting

This project deploys as a static Vite build, so Firebase Hosting serves the contents of `dist/`.

1. Create a Firebase project in the Firebase Console.
2. Replace `YOUR_FIREBASE_PROJECT_ID` in [.firebaserc](.firebaserc) and [.github/workflows/firebase-hosting.yml](.github/workflows/firebase-hosting.yml) with your real project id.
3. In GitHub repository settings, add a secret named `FIREBASE_SERVICE_ACCOUNT_CASTINGTHREEJS` containing the Firebase service account JSON.
4. Push to `main`. The workflow installs dependencies, runs `npm run build`, and deploys the build output to Firebase Hosting.

For local verification, run:

```bash
npm run build
firebase deploy --only hosting
```

---

## Controls
Expand Down
16 changes: 16 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
70 changes: 41 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.