Open Barefoot-Dev opened 1 year ago
I'm experiencing the same issue. I tried adding the installation command for firebase to the action and manually enabling experiment webframeworks but it all still fails. Is there something that can be done to automatically enable this with actions?
You have to enable the experiments for firebase tools as a separate command:
- name: Enable Firebase Experiments
run: /usr/local/bin/npx firebase-tools@latest experiments:enable webframeworks
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_POETZ_LAKE_HOUSE }}'
channelId: live
projectId: poetz-lake-house
It's annoying, but required for now
Seemingly still an issue to deploy to a preview
channel. Is there any workaround or would this get fixed anytime soon?
Thanks
You have to enable the experiments for firebase tools as a separate command:
- name: Enable Firebase Experiments run: /usr/local/bin/npx firebase-tools@latest experiments:enable webframeworks - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: '${{ secrets.GITHUB_TOKEN }}' firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_POETZ_LAKE_HOUSE }}' channelId: live projectId: poetz-lake-house
It's annoying, but required for now
For me this raises the error Could not determine the web framework in use.
For Next.js I found that it needs SSR to be deployed as a function as well, which is why the deploy fails and we see the error on pipeline but shows a different error. deploys successfully when we use firebase deploy
You can see this error when you try replicating the deploy process and run : firebase hosting:channel:deploy hosting-channel-name-here --expires 7d --project project-name-here --json
{
"status": "error",
"error": "Web frameworks with dynamic content do not yet support deploying to preview channels"
}
I see there are 2 potential fixes submitted but @FirebaseExtended hasn't accepted either one. Fix # 1 Fix # 2
Potential Replacement: https://github.com/w9jds/firebase-action
I got this to work by adding the environment variable FIREBASE_CLI_EXPERIMENTS
which is part of firebase-tools
.
- name: Deploy to Firebase
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
channelId: live
projectId: ...
env:
FIREBASE_CLI_EXPERIMENTS: webframeworks
I'm able to deploy my NextJS app directly (
firebase deploy
), however when I deploy via a PR or Merge action I get an error.My repo is structured like so (the next app is in /frontend)
My firebase.json is:
Action config
Error message
Error: Cannot deploy a web framework to hosting because the experiment webframeworks is not enabled. To enable webframeworks run firebase experiments:enable webframeworks
The process '/usr/local/bin/npx' failed with exit code 1
Expected behavior
Deploys sucessfully. I have enabled the webframeworks experiment and re-tried but to no avail.
Actual behavior
Fails to deploy.