action-hosting-deploy icon indicating copy to clipboard operation
action-hosting-deploy copied to clipboard

[BUG] Need to be able to pass run commands, so you can enable experiments.

Open solrobinson opened this issue 3 years ago • 3 comments

Action config

# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

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: {{REMOVED}}
          channelId: live
          projectId: {{REMOVED}}

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

Expected behavior

This would kind of be expected behaviour, as it is right to fail as experiments has not been enabled, however, it is impossible to enable experiments, as the firebase-tools package is installed before you can next run a command to enable it.

Actual behavior

Errors

solrobinson avatar Nov 04 '22 14:11 solrobinson

- run: /usr/local/bin/npx firebase-tools@latest experiments:enable webframeworks

Workaround is to add this line just before

- uses: FirebaseExtended/action-hosting-deploy@v0

But would be useful for future to allow for this without having to install the firebase-tools package before it was supposed to be install by FirebaseExtended/action-hosting-deploy@v0

Probably can be changed from "bug" to "enhancement"

solrobinson avatar Nov 04 '22 14:11 solrobinson

FWIW there's also an environment variable means of opting into the experiment. Probably more suitable for the action.

jamesdaniels avatar Nov 04 '22 22:11 jamesdaniels

FWIW there's also an environment variable means of opting into the experiment. Probably more suitable for the action.

Specifically (h/t @jamesdaniels) https://github.com/FirebaseExtended/firebase-framework-tools/issues/34#issuecomment-1290573368)

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

disusered avatar Nov 10 '22 21:11 disusered