Kojay
Kojay

Reputation: 193

How can run firebase experiments:enable webframeworks with GitHub actions?

When I try to deploy nextjs project on firebase with GitHub action, I got an 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

I tried

firebase experiments:enable webframeworks

from my computer but it still did not work.

Here is the yaml file for the GitHub action.

name: Deploy to Firebase Hosting on merge
'on':
  push:
    branches:
      - main
jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: npm ci && npm run build
      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: '${{ secrets.GITHUB_TOKEN }}'
          firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
          channelId: live
          projectId: my-project

Could you help me to enable webframeworks with GitHub actions?

Thanks!

Upvotes: 19

Views: 8581

Answers (1)

TheIronDeveloper
TheIronDeveloper

Reputation: 3624

You can enable webframeworks by updating the yaml like so:

  - uses: FirebaseExtended/action-hosting-deploy@v0
     with:
       # ...
     env:
       FIREBASE_CLI_EXPERIMENTS: webframeworks

The pull request that implemented the feature is: firebase-tools#5069

This feature was introduced at version v11.14.2.

Upvotes: 45

Related Questions