Reputation: 431
how to deploy to other firebase hosting sites defined within the same project. I created multiple firebase hosting "sites". The command
firebase deploy
however always deploys to the first one. How can I specify that the static files get deployed to another "site" (and domain).
Thanks
Upvotes: 28
Views: 28986
Reputation: 341
To deploy to another site created in same firebase project. Update your firebase.json file as folow
{
"hosting": {
"site":"<site-name>",
"public": ...,
"ignore": [
...
],
"rewrites": [
...
]
}
}
Upvotes: 13
Reputation: 47833
You have to add the other sites as deploy targets. If you have a second site named awesome-site-d3426
:
$ firebase target:apply hosting awesome-app awesome-site-d3426
You'll likely have to do the same thing for the primary site.
Then tell Firebase what to deploy to which targets in firebase.json
:
{
"hosting": [
{
"target": "awesome-site",
"public": "awesome-site/dist"
},
{
...
}
]
}
You can then deploy all the sites at once(firebase deploy
) or a specific site:
$ firebase deploy --only hosting:awesome-site
Upvotes: 51