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
695 stars 202 forks source link

Workflow inputs to dynamically deploy to channel #227

Open iqfareez opened 2 years ago

iqfareez commented 2 years ago

The use case you're trying to solve

I'm building a a workflow where maintainer can select the channel they want the app is published into. For example, live, staging (long-lived preview), and (new preview)

image

name: Deploy to Firebase Hosting
"on":
  workflow_dispatch:
    inputs:
      deployChannel:
        description: "Channel which Firebase will deploy into"
        default: ""
        type: choice
        options:
          - live
          - staging
          -

... some actions

 - name: Deploy to Firebase Hosting
        uses: FirebaseExtended/action-hosting-deploy@v0
        id: firebaseHost
        with:
          repoToken: "${{ secrets.GITHUB_TOKEN }}"
          firebaseServiceAccount: "${{ secrets.SOME_SECRETS }}"
          channelId: ${{ inputs.deployChannel }} # value from the input above
          projectId: someprojectid

If I understand from the docs, the deploy to a new preview channel, just leave the channelId property empty. I tried to achive that by passing an empty value.

However, on clicking Run workflow. GitHub immediately crashed, seems like it didn't support empty value?

image

Mohammedsahari commented 1 year ago

The use case you're trying to solve

I'm building a a workflow where maintainer can select the channel they want the app is published into. For example, live, staging (long-lived preview), and (new preview)

image

name: Deploy to Firebase Hosting
"on":
  workflow_dispatch:
    inputs:
      deployChannel:
        description: "Channel which Firebase will deploy into"
        default: ""
        type: choice
        options:
          - live
          - staging
          -

... some actions

 - name: Deploy to Firebase Hosting
        uses: FirebaseExtended/action-hosting-deploy@v0
        id: firebaseHost
        with:
          repoToken: "${{ secrets.GITHUB_TOKEN }}"
          firebaseServiceAccount: "${{ secrets.SOME_SECRETS }}"
          channelId: ${{ inputs.deployChannel }} # value from the input above
          projectId: someprojectid

If I understand from the docs, the deploy to a new preview channel, just leave the channelId property empty. I tried to achive that by passing an empty value.

However, on clicking Run workflow. GitHub immediately crashed, seems like it didn't support empty value?

image