netlify / actions

MIT License
375 stars 59 forks source link

Pull Request Preview? #14

Open NullVoxPopuli opened 5 years ago

NullVoxPopuli commented 5 years ago

I'd love to be able to:

I think if lots of people adopted this strategy of deployment, it would save netlify a bunch of money in build-server time ;)

kitop commented 5 years ago

Hi @NullVoxPopuli

I think you should be able to do so with the netlify cli action: https://github.com/netlify/actions/tree/master/cli

Adding that as a step after the test linting ones run in GH Actions, and you could deploy without the --prod flag to create a draft deploy. More details in the cli docs:

Let me know if that helps!

NullVoxPopuli commented 5 years ago

Can those be tied to pull requests? I'd like the deploy preview / branch deploy to be visitable from the PR checks links

NullVoxPopuli commented 5 years ago

Also, would they auto clean up after some period of staleness?

kitop commented 5 years ago

Can those be tied to pull requests? I'd like the deploy preview / branch deploy to be visitable from the PR checks links

Unfortunately, you can't tie those to a PR/branch if it wasn't deployed from a GitHub webhook. You could probably add some extra logic in a script to get the output of the deploy command and create a status check from GH Actions.

Also, would they auto clean up after some period of staleness?

No.

calitb commented 4 years ago

@NullVoxPopuli I think I did what you mentioned in your comment. You can check my workflow here:

https://github.com/calitb/VueJS-Sample/blob/master/.github/workflows/deploy_staging.yml

Tanuj22 commented 3 years ago

@NullVoxPopuli I think I did what you mentioned in your comment. You can check my workflow here:

https://github.com/calitb/VueJS-Sample/blob/master/.github/workflows/deploy_staging.yml

@calitb Thank you for this. This was failing when a PR is from a forked repo. Do you know why?

calitb commented 3 years ago

sorry, no idea

tlylt commented 2 years ago

@NullVoxPopuli I think I did what you mentioned in your comment. You can check my workflow here: https://github.com/calitb/VueJS-Sample/blob/master/.github/workflows/deploy_staging.yml

@calitb Thank you for this. This was failing when a PR is from a forked repo. Do you know why?

This is likely because of permission issues when PRs are triggered from a forked repo(i.e the workflow has no access to the secrets), hence failing to complete. See the details here