Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull Request Preview? #14

Open
NullVoxPopuli opened this issue Oct 5, 2019 · 8 comments
Open

Pull Request Preview? #14

NullVoxPopuli opened this issue Oct 5, 2019 · 8 comments

Comments

@NullVoxPopuli
Copy link

I'd love to be able to:

  • not deploy a preview unless tests / linting passes
  • not use netlify's build servers, as my github actions already have the built assets -- it's be much faster to pass my pre-built files to netlify via upload.

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

@kitop
Copy link
Contributor

kitop commented Oct 12, 2019

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
Copy link
Author

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

@NullVoxPopuli
Copy link
Author

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

@kitop
Copy link
Contributor

kitop commented Nov 11, 2019

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
Copy link

calitb commented Jul 22, 2020

@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
Copy link

Tanuj22 commented Feb 4, 2021

@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
Copy link

calitb commented Feb 5, 2021

sorry, no idea

@tlylt
Copy link

tlylt commented Mar 9, 2022

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants