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

Implement Docker Image Publishing on New Tag Creation #373

Merged
merged 7 commits into from
May 16, 2023

Conversation

phutelmyer
Copy link
Contributor

@phutelmyer phutelmyer commented May 16, 2023

Describe the change
This pull request includes changes to our GitHub Actions workflow, specifically targeting the process of building and pushing Docker images. The new workflow will trigger whenever a new tag is created in the repository.

Images are now being pushed to https://hub.docker.com/u/target

Changes Include:

  • The workflow is now triggered on tag creation instead of push to the publish-images branch.
  • The image build and push process has been streamlined using an associative array in Bash. This should make the script more maintainable and easier to expand if we add more components in the future.
  • The Dockerfiles' paths and their respective image names have been included in the associative array. This approach simplifies the process of adding or modifying Dockerfiles and corresponding images.
  • Added error handling to the script. The workflow will now stop if any command within the Build, Tag and Push Images step fails.
  • The script now includes comments, making it more readable and easier to understand.

The updated workflow:

  1. Checks out the repository.
  2. Logs in to Docker Hub.
  3. Builds, tags, and pushes each Docker image.
  4. Logs out from Docker Hub.

Describe testing procedures
N/A

Sample output
N/A

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of and tested my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@phutelmyer phutelmyer merged commit 684fe41 into publish-images May 16, 2023
@phutelmyer phutelmyer deleted the publish-images-all branch May 22, 2023 13:01
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.

1 participant