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

GitHub actions to build and push a new docker image when a new release is published #72

Merged
merged 10 commits into from
Sep 16, 2020
Merged

GitHub actions to build and push a new docker image when a new release is published #72

merged 10 commits into from
Sep 16, 2020

Conversation

eugene-manuilov
Copy link
Collaborator

@eugene-manuilov eugene-manuilov commented Sep 16, 2020

Description of the Change

This PR adds a new GitHub Actions file that builds and pushes a new docker image when a release is published. When it builds a docker image, it uses a tarball archive generated by GitHub and associated with the release. It also tags the new image with the release name and a major version. For example, when 2.1.0 release is published, it will create a new image with the following tags: latest, 2.1.0, and 2.

The docker image itself is different from one that is currently used by the 10up/wp-local-docker-images. Probably, it is worth asking a system engineer to check it and provide feedback.

To make GitHub actions work correctly, we need to add two variables to this repo secrets: DOCKERHUB_ACCESS_TOKEN DOCKERHUB_USERNAME. The first one should contain an access token generated in the docker hub, and the second one should contain a username used in the docker hub.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

@eugene-manuilov eugene-manuilov marked this pull request as ready for review September 16, 2020 10:28
@tlovett1 tlovett1 merged commit c033cb2 into 10up:develop Sep 16, 2020
@TheLastCicada
Copy link

@eugene-manuilov This is super cool and I'm really happy we have this automatically running in Actions. I have just a few questions....

  1. Why did we get away from using the official Docker action for building and pushing images https://github.com/docker/build-push-action ? I see we had it in here in one of the earlier commits and I like the way it handles logins..... seems like it would be the most reliable solution going forward.

  2. Can you tell me more about the image we use that is different than in 10up/wp-local-docker-images? Why are we using a different image here? I'm not sure it needs to be standardized, but maybe it should - I agree that I'd like @dustinrue or Jason to take a look and see what they think.

@eugene-manuilov
Copy link
Collaborator Author

Hi @TheLastCicada

  1. Why did we get away from using the official Docker action for building and pushing images? I see we had it in here in one of the earlier commits and I like the way it handles logins..... seems like it would be the most reliable solution going forward.

I have never worked with the official docker actions before. Plus, I found it a little bit confusing when I tried it at the beginning. Now, I think I agree with you and will give it another try next week.

  1. Can you tell me more about the image we use that is different than in 10up/wp-local-docker-images? Why are we using a different image here?

The current 10up/wpsnapshots:latest image isn't functional. When I tried to use it in the wp-local-docker instead of the dev version, it failed. I tried to find out how we build the dev image unsuccessfully and decided to create a new one that would work. Fortunately, I figured out how the dev image was built and have created a new PR (#74) that updates the dockerfile to be almost identical to what we use for the dev tag now. The only differences there are how we install wpsnapshots and which additional information we display when a container runs.

@eugene-manuilov
Copy link
Collaborator Author

@TheLastCicada i have updated GitHub actions to use the official Docker actions for it. All works perfectly.

@jeffpaul jeffpaul added this to the 2.1.0 milestone Nov 6, 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

Successfully merging this pull request may close these issues.

4 participants