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

Trigger a build commit on push to master #41

Closed
tpenguinltg opened this issue Apr 23, 2020 · 5 comments
Closed

Trigger a build commit on push to master #41

tpenguinltg opened this issue Apr 23, 2020 · 5 comments

Comments

@tpenguinltg
Copy link

Set up Travis CI so that when commits are pushed to the master branch, the project is built and the result is pushed back to master. This should make pull request diffs easier to read and it will prevent branches from being polluted with "Build project" commits every time a change is requested.

@jdan
Copy link
Owner

jdan commented Apr 23, 2020

Happy to set this up, but didn't know that was possible! Figured I needed to use the GitHub API to do any committing and pushing. Got docs for this handy?

@tpenguinltg
Copy link
Author

I don't have any experience with doing it in Travis myself (or with Travis in general), but you might find this Gist useful. The basic idea is to create a personal access token for authentication, but otherwise do your normal Git operations after setting Git's user details. You can see the Gist for details.

As for invoking this only on master, you can make use of a conditional stage or job.

@ghost
Copy link

ghost commented Apr 24, 2020

I wonder if there is an equivalent in github actions through https://help.github.com/en/actions/reference/events-that-trigger-workflows. I just started playing around with this myself so it caught my eye.

I am not too experienced myself with this either, but I wonder if there are certain advantages between both of these 😄

@tpenguinltg
Copy link
Author

I saw a Travis CI config and thought that that was what was being used, but I see now that there are GitHub actions set up that actually do something. I'd recommend doing this with GitHub actions instead of Travis if that's what's being used.

@jdan
Copy link
Owner

jdan commented Apr 29, 2020

We don't check in dist anymore and have vercel running on commit :) Gonna close this as a no-op.

@jdan jdan closed this as completed Apr 29, 2020
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

2 participants