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 workflow for building and pushing multi-platform Docker images to Docker Hub #78

Merged
merged 4 commits into from
Jul 9, 2024

Conversation

joel-ling
Copy link
Member

@joel-ling joel-ling commented Jun 24, 2024

Merging this pull request would add two Actions workflows:

  • "Build and push semver-tagged Docker image"
  • "Build and push Docker image tagged main"

The first of the two workflows runs automatically whenever a tag of the following format is pushed: v[0-9]+.[0-9]+.[0-9]+. The second is run whenever the main branch is pushed to.

Both workflows build and push images for the platforms specified by the Actions variable PLATFORMS.

Image tags are formatted as follows:

  • <ORGANISATION_NAME>/<IMAGE_NAME>:<MAJOR>.<MINOR>.<PATCH> (and latest), or
  • <ORGANISATION_NAME>/<IMAGE_NAME>:main, as may be the case.

The Docker Hub organisation name, username, and access token are automatically populated with GitHub Actions Secrets, while the image name is an Actions variable of the repository.

@joel-ling joel-ling changed the title GitHub Actions workflow for building and pushing Docker images to Docker Hub GitHub Actions workflow for building and pushing multi-platform Docker images to Docker Hub Jun 24, 2024
@joel-ling joel-ling removed request for wojas and nvaatstra June 28, 2024 01:18
Copy link
Contributor

@neilcook neilcook left a comment

Choose a reason for hiding this comment

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

LGTM, just a comment about the master tag.

I guess this is hard to test without actually pushing to the main branch or tagging a release.

push: true
sbom: true
tags: >-
${{ secrets.DOCKERHUB_ORGANIZATION_NAME }}/${{ vars.IMAGE_NAME }}:master
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that we have a main branch not a master branch, using the master tag feels a little weird.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, @neilcook!

Given that we have a main branch not a master branch, using the master tag feels a little weird.

I have changed the tag from master to main.

I guess this is hard to test without actually pushing to the main branch or tagging a release.

Not to worry, the workflows are passing in the fork (we are about to merge), albeit using alternative variables and secrets, hence pushing to a different repository on Docker Hub.

@joel-ling joel-ling merged commit 103892a into PowerDNS:main Jul 9, 2024
5 of 6 checks passed
@joel-ling
Copy link
Member Author

Confirmed that powerdns/lightningstream:main is available on Docker Hub. powerdns/lightningstream:v0.4.4 or powerdns/lightningstream:v0.5.0 (and powerdns/lightningstream:latest) should automatically become available upon the next release.

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