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

Build docker images automatically #115

Merged
merged 3 commits into from
Dec 7, 2024

Conversation

JayVii
Copy link
Contributor

@JayVii JayVii commented Nov 6, 2024

This PR creates a CD workflow that will build a new docker-image for every push to a tag (including the creation of a tag) in the form of v1.2.3.

The images will be pushed to the github registry of this repository with the image tags taken from the git tag (i.e. for the major 1, the major-minor 1.2, the major-minor-patch 1.2.3 as well as the latest tag.

The Dockerfile will by default build from the main branch, which makes development easier in a docker-workflow. The CD however will always use the tag as build-arg.

This is my first github-workflow (I did write many gitlab CI/CD pipelines). Information was taken from https://github.com/docker/build-push-action & https://github.com/docker/metadata-action

I did test this CD in my own fork: https://github.com/JayVii/ktistec/actions & https://github.com/JayVii/ktistec/tree/test_actions

I did testing builds (some with fake versions and some with proper) that have been pushed here: https://github.com/JayVii/ktistec/pkgs/container/ktistec

@JayVii
Copy link
Contributor Author

JayVii commented Nov 6, 2024

@toddsundsted you did mention, that you would like to see this for ktistec, so I thought I might try to create it. If this gets merged, I can finally get rid of my manual builds

@JayVii
Copy link
Contributor Author

JayVii commented Nov 6, 2024

This is different from #47 in that it uses Github's registry rather than dockerhub and uses tagging. #47 uses docker/setup-buildx-action, which if I am not mistaken can cross-build, which would be a nice addition here too

Copy link
Owner

@toddsundsted toddsundsted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the super-slow review. One question on build step version.

.github/workflows/cd.yml Outdated Show resolved Hide resolved
@toddsundsted toddsundsted merged commit 1490b81 into toddsundsted:main Dec 7, 2024
1 of 2 checks passed
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.

2 participants