-
Notifications
You must be signed in to change notification settings - Fork 94
Migrate from Travis to GitHub Action #228
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
Conversation
Deploy preview for open-api ready! Built with commit f2481fb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I can't judge for the Go part, but the Node.js part looks good 👍
# Ensure GitHub actions are not run twice for same commits | ||
push: | ||
branches: [master] | ||
tags: ['*'] | ||
pull_request: | ||
types: [opened, synchronize, reopened] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on traffic mesh we are not seeing duplicated runs with just on: push
: https://github.com/netlify/traffic-mesh/blob/master/.github/workflows/rust.yml#L3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confess that I copy&pasted from https://github.com/netlify/js-client/blob/1000eac0fdf9434336adefdde5cce1d46c02d60e/.github/workflows/workflow.yml#L2-L8 , any opinions/suggestions @ehmicky ? (as I copy pasted from you :P)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was suggested by @erezrokah and was originally copied from netlify-cms
.
When doing only push
, PRs that come from forked repositories do not seem to be included.
When doing both push
and pull_request
, PRs that come from non-forked repositories are run twice, which is the reason behind branches: [master]
. The tags
and types
are just the default values (can be removed).
@erezrokah Please correct me if I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, that explains why i haven't seen it on a private repo 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 🎉 very good to know, thanks for tips @ehmicky and @erezrokah , sounds like we could copypasta this whenever we migrate other open source repos too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing to consider is that GitHub secrets are not passed to actions triggered from forked repositories.
We had to create a separate testing flow for the CMS project:
https://github.com/netlify/netlify-cms/blob/b5a242ec8ed627e7f5e2ce8af454dd1dda1f71cc/.github/workflows/nodejs.yml#L104
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to know, thanks for sharing @erezrokah ! I think it won't be a problem with this repo but I'll keep it in my mind 👍
Co-Authored-By: Marcus Weiner <[email protected]>
Co-Authored-By: Marcus Weiner <[email protected]>
Several other Netlify open source repositories migrated to GitHub action already, it'd be nice to do so with open-api too.
Note: workflow is pretty much copy&paste from everywhere, any feedback is welcome.