diff --git a/.firebaserc b/.firebaserc index a109eff..9af6db5 100644 --- a/.firebaserc +++ b/.firebaserc @@ -1,5 +1,17 @@ { "projects": { "default": "betterplacestreambot" + }, + "targets": { + "betterplacestreambot": { + "hosting": { + "production": [ + "betterplacestreambot" + ], + "staging": [ + "bp42streambot" + ] + } + } } } diff --git a/Makefile b/Makefile index 2b2d9ac..c62bea4 100644 --- a/Makefile +++ b/Makefile @@ -10,5 +10,12 @@ start: setup build: setup src/**/* yarn build -deploy: build - firebase deploy + +deploy-staging: build + firebase deploy --only hosting:bp42streambot + +deploy-production: build + firebase deploy --only hosting:betterplacestreambot + +deploy: + @echo Deploy to staging/production with targets deploy-staging/deploy-production respectively. diff --git a/README.md b/README.md index 17ca788..7832732 100644 --- a/README.md +++ b/README.md @@ -225,17 +225,27 @@ Customization parameters: ## Build & Deploy +Enter + +``` +$ make deploy-staging +``` + +or + ``` -$ make deploy +$ make deploy-production ``` +to deploy the current revision. + In case of error 401: ``` $ firebase login --reauth ``` -The latest deployed version can then be seen via these URLs: +The latest deployed revision can then be seen via these URLs: - https://streambot.bp42.com/fundraising-events/30943/standard - https://streambot.betterplace.org/fundraising-events/30943/standard diff --git a/firebase.json b/firebase.json index cfbc74c..f383c44 100644 --- a/firebase.json +++ b/firebase.json @@ -1,12 +1,34 @@ { - "hosting": { - "public": "build", - "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], - "rewrites": [ - { - "source": "**", - "destination": "/index.html" - } - ] - } + "hosting": [ + { + "target": "production", + "public": "build", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } + ] + }, + { + "target": "staging", + "public": "build", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } + ] + } + ] }