-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
add github actions to build/push docker images #6679
Conversation
@@ -0,0 +1,30 @@ | |||
name: Build and Publish Snapshot Docker Image | |||
on: create |
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 gather GitHub still haven't added a tag
create filter to this like they have for release
?
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.
Yeah there isn't a specific event for tag creation. create
is fired when a new ref is created. A ref can either be a tag or a branch, so the way to run an action on tag create is
on: create
jobs:
build:
if: github.event.ref_type == 'tag'
I'm inclined to go ahead and make the pivot vs. waiting to see. Maybe we could hold off till the July image publish though. |
Published ok using native dockerhub build: |
Indeed. Think I'm just a bit paranoid about waiting and having the on-demand/latest builds failing without us realizing. I don't feel strongly about it at all though so we can certainly park it for a while if you'd prefer |
Going to just leave this one "in the chamber" while the DockerCloud builds continue to run. |
Looks like DockerHub disabled our builds about a week ago so I am going to merge this. |
Closes #6634
We made this switch on another repo I work on so I basically already had this knocking about.. these two actions are very slightly adapted from the solution we've used there.
In anticipation, I have set up
DOCKERHUB_USERNAME
andDOCKERHUB_TOKEN
variables in https://github.com/badges/shields/settings/secrets/actions . I've used a token attached to my dockerhub account (which should have permission to push toshieldsio/shields
on dockerhub). We could maybe look at setting up a special bot/machine account for this though if we wanted.Interestingly the DockerHub builds for our repo seem to still be working even though they were theoretically turned off last week. I did have a look to see if Docker have announced a U-turn or extension but the latest word is that autobuilds for free plans should have been disabled on 18th June. We could just keep this PR "in the chamber" and wait to see if they actually break at some point before we make the switch. If we want to just go ahead with this, before we merge this we should probably disable the autobuilds on DockerHub so we don't have two builds trying to push to the same tags.