Skip to content

Commit 8f244fe

Browse files
authored
Merge pull request #2 from uno-sw/firebase-hosting
Set up Firebase Hosting
2 parents c80ad50 + a3b3ced commit 8f244fe

File tree

4 files changed

+73
-0
lines changed

4 files changed

+73
-0
lines changed

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "unosw-flutter-synth-b96d5"
4+
}
5+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
- uses: subosito/flutter-action@v2
15+
with:
16+
channel: stable
17+
flutter-version: 3.29.3
18+
- run: flutter pub get
19+
- run: flutter build web --wasm
20+
- uses: FirebaseExtended/action-hosting-deploy@v0
21+
with:
22+
repoToken: ${{ secrets.GITHUB_TOKEN }}
23+
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNOSW_FLUTTER_SYNTH_B96D5 }}
24+
channelId: live
25+
projectId: unosw-flutter-synth-b96d5
26+
env:
27+
FIREBASE_CLI_EXPERIMENTS: webframeworks
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
- uses: subosito/flutter-action@v2
17+
with:
18+
channel: stable
19+
flutter-version: 3.29.3
20+
- run: flutter pub get
21+
- run: flutter build web --wasm
22+
- uses: FirebaseExtended/action-hosting-deploy@v0
23+
with:
24+
repoToken: ${{ secrets.GITHUB_TOKEN }}
25+
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNOSW_FLUTTER_SYNTH_B96D5 }}
26+
projectId: unosw-flutter-synth-b96d5
27+
env:
28+
FIREBASE_CLI_EXPERIMENTS: webframeworks

firebase.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"hosting": {
3+
"source": ".",
4+
"ignore": [
5+
"firebase.json",
6+
"**/.*",
7+
"**/node_modules/**"
8+
],
9+
"frameworksBackend": {
10+
"region": "asia-east1"
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)