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

Maintenance: retry when 'push to netlify' failed #360

Open
northword opened this issue Dec 1, 2024 · 4 comments
Open

Maintenance: retry when 'push to netlify' failed #360

northword opened this issue Dec 1, 2024 · 4 comments

Comments

@northword
Copy link
Member

There is some probability of failure to push to netlify using the command line, which seems to be usually due to network reasons.

especially for prod deploy: https://github.com/nolebase/integrations/actions/runs/12101328863/job/33741038395#step:10:130

Since prod deploy doesn't need to get the url, we can use a retry action, for example: https://github.com/zotero-chinese/website/blob/main/.github%2Fworkflows%2Fci.yml#L85-L93

But preview deploy still fails often, this way can't be solved because with retry we can't get the deployed url.

or is there another better way?

@LittleSound
Copy link
Member

Is this because we use Github Actions to push to netlify?

@nekomeowww
Copy link
Member

@LittleSound Yes

@northword
Copy link
Member Author

In my flow, I build the site via GitHub Action and commit the dist to the gh-pages branch of the xxx.github.io repository.

Then, have Netlify link to the gh-pages branch of the xxx.github.io repository.

This has the following benefits:

  • Compile using GitHub Action, avoiding duplicate compilation of Action and Netlify and saving netlify compile time credits.

  • Commit to the xxx.github.io repository, which makes compatibility with github pages very easy.

  • Netlify deployment is done by Netlify, not through netlify-cli, reducing push-to-netlify-like errors.

However, this approach is also only for prod deployments (e.g., ci triggered by push) and does not satisfy preview deployments (e.g., ci triggered by pr)

@nekomeowww
Copy link
Member

I think this is a Netlify side issue where we shouldn't put so much our time on it.

And retries can be implemented through other GitHub Actions helper from Marketplace.

We are not limited to use GitHub Actions native functions, it's just too hard to find a well-maintained Action, so feel free to find some, and just replace with it.

Regardless to the GitHub Actions and workflows, we can manually retry from Actions, its not a big problem.

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

3 participants