Open BossBele opened 3 years ago
@expatiating You gotta be experienced in this
I have the same problem when implementing the workflow described here. The only difference to my setup is that I have multiple sites, too. As SITE_ID must be globally unique within Firebase (docs), I can't define my targets in .firebaserc
. Let me explain this with my setup.
These are my two Firebase Projects with their own hosting sites:
I'm not sure what's the best solution for this problem. My first thought was letting the user define some script which gets executed in this action before the deploy so this becomes possible. Any ideas?
@logineimer, I'm experiencing the same issue! Did you find any solution? I discovered that you could specify the config source like this$ firebase --config=./firebase-main.json deploy
, but there's no support for this in this project. I guess I'll try to add one.
@ItayElgazar, unfortunately not. I changed my site setup to one hosting site. This works out for me for multiple reasons. However, I'd still like to this issue resolved. :)
I added the support to use --config
, but it looks like nobody approves PRs here 😞
I was getting this, but it turns out I didn't have my .firebaserc file committed! It works perfectly now! Running firebase target:....
actually updates the .firebaserc file.
Same issue here
@mvarchdev is your .firebaserc
file ignored or commited?
Also in firebase.json
do you see site
under hosting
?
"hosting" : {
"site": ""
}
For me, solved when update the .firebaserc
with:
{
"projects": {
"default": "<project-id>"
},
+ "targets": {
+ "<project-id>": {
+ "hosting": {
+ "<target>": [
+ "<site-name>"
+ ],
+ "<target-2>": [
+ "<site-name-2>"
+ ]
+ }
+ }
+ }
}
And in Github action YAML added the target configured in .firebaserc
:
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
channelId: live
projectId: <project-id>
+ target: <target>
The multi-sites work for me when I remove the "default" setting. From this:
"projects": { "default": "<project-id>" },
to this:
"projects": {},
Action config
Error message
Unexpected behavior
When I push .firebaserc to my repo, action succeeds. When I use projectId and target, action fails.