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

Use preview channel url prior to asset build #272

Closed naturedamends closed 1 year ago

naturedamends commented 1 year ago

The use case you're trying to solve

I would like to get the URL of the preview channel and use it in the build of the assets i'm going to deploy.

When a channel is created, I would like to retain the random hash. Such that, for example, a branch may have multiple preview sites.

Change to the action that would solve that use case

uses: FirebaseExtended/action-hosting-deploy@v0
with:
  bulid: npm build [passing url parameter here]

Other considerations

I can do this with a POST request to create and the a GET request to the channel REST endpoints. But it would be nice to have it configured out of the box. I'm happy to submit the PR if you think its a good idea. Any advise? i'm not sure on the best way to get the variable into the npm start command. Without string replacing it, since it would be determined at runtime. It won't be available when parsing the yaml definition... just reading the code. Any pointer welcomed