Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sapientcoffee/firebase-hosting
https://github.com/sapientcoffee/firebase-hosting
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/sapientcoffee/firebase-hosting
- Owner: sapientcoffee
- Created: 2021-09-22T17:34:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-27T15:25:59.000Z (over 3 years ago)
- Last Synced: 2024-12-06T21:34:53.193Z (about 1 month ago)
- Language: HTML
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Firebase Hotsing Demo
## Setup
You will require;
* 2x GCP Projects with Firebase eneabled
* GitHub repo linked to the GCP project(s)
* Enable Cloud Build API and correct SAexport PROJECT_ID_STAGE="coffee-stage"
export PROJECT_ID_PROD="coffee-live"
firebase hosting init### Cloud Build Firebase Community Builder
```
git clone https://github.com/GoogleCloudPlatform/cloud-builders-community.git
cd cloud-builders-community/firebase
gcloud builds submit .
cd ../..
rm -rf cloud-builders-community/
```gcloud builds submit --config cloudbuild.yaml .
## Hosting
firebase deploy --only hosting
### Create Dev/Prod projects
```bash
# Swap between projects
firebase use# To create new aliases, for example link "dev" to one of the projects
firebase use --add
```This will create a file `.firebaserc` which will have the config, you can also alter this directly. An example is;
```json
{
"projects": {
"prod": "big-rob",
"dev": "coffee-with-rob"
}
}
```Now allows you to specify the environment with the CLI;
```bash
firebase deploy --only hosting --project dev
```## Build Container Image
### Dockerfile
```
gcloud builds submit --tag gcr.io/$PROJECT_ID/coffeefire
````predeploy` hooks in firebase.json
predeplopy : ["npm ci", "npm run build"],
### Buildpacks
deploy to cloud run
```
gcloud run deploy --image gcr.io/$PROJECT_ID/coffeefire
````firebase.json`
```
firebase deploy
```## Lets Pipeline it
cloud build for hosting deployment
cloud build of Cloud RUn deployment