Skip to content

Commit

Permalink
Firebase Hosting Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ssreekar committed Dec 31, 2021
1 parent eea88ca commit 3d278b4
Show file tree
Hide file tree
Showing 9 changed files with 1,269 additions and 194 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
'on':
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_TOMATIMER_1A435 }}'
channelId: live
projectId: tomatimer-1a435
17 changes: 17 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
'on': pull_request
jobs:
build_and_preview:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_TOMATIMER_1A435 }}'
projectId: tomatimer-1a435
14 changes: 14 additions & 0 deletions tomatimer/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"projects": {
"default": "tomatimer-1a435"
},
"targets": {
"tomatimer-1a435": {
"hosting": {
"tomatimer": [
"tomatimer-1a435"
]
}
}
}
}
5 changes: 5 additions & 0 deletions tomatimer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ testem.log
# System Files
.DS_Store
Thumbs.db

# Firebase
.firebase
*-debug.log
.runtimeconfig.json
12 changes: 11 additions & 1 deletion tomatimer/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,19 @@
],
"scripts": []
}
},
"deploy": {
"builder": "@angular/fire:deploy",
"options": {
"prerender": false,
"ssr": false,
"browserTarget": "tomatimer:build:production",
"firebaseProject": "tomatimer-1a435",
"firebaseHostingSite": "tomatimer-1a435"
}
}
}
}
},
"defaultProject": "tomatimer"
}
}
7 changes: 7 additions & 0 deletions tomatimer/database.rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
/* Visit https://firebase.google.com/docs/database/security to learn more about security rules. */
"rules": {
".read": false,
".write": false
}
}
54 changes: 54 additions & 0 deletions tomatimer/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"hosting": [
{
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "tomatimer",
"public": "dist/tomatimer",
"ignore": [
"**/.*"
],
"headers": [
{
"source": "*.[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].+(css|js)",
"headers": [
{
"key": "Cache-Control",
"value": "public,max-age=31536000,immutable"
}
]
},
{
"source": "/@(ngsw-worker.js|ngsw.json)",
"headers": [
{
"key": "Cache-Control",
"value": "no-cache"
}
]
}
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
],
"database": {
"rules": "database.rules.json"
}
}
Loading

0 comments on commit 3d278b4

Please sign in to comment.