FirebaseExtended / action-hosting-deploy

Automatically deploy shareable previews for your Firebase Hosting sites
https://firebase.google.com/docs/hosting/github-integration
Apache License 2.0
704 stars 202 forks source link

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

Open solrobinson opened 2 years ago

solrobinson commented 2 years ago

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 commented 2 years ago
- 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"

jamesdaniels commented 2 years ago

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

disusered commented 2 years ago

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