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

Add workflows to publish docker container on release #451

Merged
merged 4 commits into from
Jan 9, 2025

Conversation

soapy1
Copy link
Contributor

@soapy1 soapy1 commented Dec 31, 2024

follow up to #450

Description

This PR adds 2 new GHA workflows:

  • build docker image (on every pull request)
  • adds building+publishing docker image to GH container registry as part of the release workflow

Pull request checklist

  • Did you test this change locally?
  • Did you update the documentation (if required)?
  • Did you add/update relevant tests for this change (if required)?

@soapy1 soapy1 changed the title Add docker release workflow Add docker workflows Dec 31, 2024
@soapy1 soapy1 force-pushed the add-docker-release-workflow branch 2 times, most recently from b58d9cb to 5206920 Compare December 31, 2024 20:17
@soapy1 soapy1 force-pushed the add-docker-release-workflow branch 9 times, most recently from 878177c to 622c9b7 Compare January 3, 2025 22:33
@soapy1
Copy link
Contributor Author

soapy1 commented Jan 3, 2025

Are there any docs that should be updated about publishing this new release artifact?

@soapy1 soapy1 marked this pull request as ready for review January 3, 2025 22:36
@soapy1 soapy1 marked this pull request as draft January 7, 2025 17:15
@soapy1 soapy1 changed the title Add docker workflows Add workflows to publish docker container on release Jan 7, 2025
@soapy1 soapy1 force-pushed the add-docker-release-workflow branch 3 times, most recently from 7806e64 to 8f9c835 Compare January 7, 2025 19:30
@soapy1 soapy1 force-pushed the add-docker-release-workflow branch from 8f9c835 to d9b3055 Compare January 7, 2025 19:30
@soapy1 soapy1 marked this pull request as ready for review January 7, 2025 19:34
@soapy1 soapy1 requested review from gabalafou and trallard January 7, 2025 20:28
Copy link
Contributor

@gabalafou gabalafou left a comment

Choose a reason for hiding this comment

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

I'm not sure I'm the right person to review GitHub workflows. I am not familiar enough with workflow files (nor specific workflows such as uploading Docker images) to be able to spot errors.

But I gave this a careful look and left some questions and comments.

.github/workflows/build-docker-image.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
tags: |
${{ steps.meta.outputs.tags }}
push: true
labels: ${{ steps.meta.outputs.labels }}
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the difference between tags and labels?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Labels contain metadata about the image (ref link). Tags denote a version of the image. So like, when you go to pull a docker image the form is docker pull <maybe repo>/<namespace>/<image name>:<tag>. For the demo published conda-store-ui container, that is docker pull ghcr.io/conda-incubator/conda-store-ui:sha256-c8c4ab110fec1d39f91ba86df89811bdd5c93bb92037ffb550a684f63ef15c64

.github/workflows/release.yml Show resolved Hide resolved
@gabalafou
Copy link
Contributor

Are there any docs that should be updated about publishing this new release artifact?

I noticed that there are manual steps in RELEASE.md in case the GitHub action fails. Should there be manual steps for how to publish the Docker image?

@soapy1 soapy1 force-pushed the add-docker-release-workflow branch from 714640e to b0ec2e1 Compare January 8, 2025 20:36
@soapy1 soapy1 requested a review from gabalafou January 9, 2025 17:35

jobs:
build_docker_image:
name: "Build Docker Images 🛠"
Copy link
Contributor

Choose a reason for hiding this comment

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

On the subject of how this appears in the list of checks, currently this shows up as: "Build Docker image / Build Docker Images 🛠️"

I wonder if we can come up with a better combo. Docker / Build image? Not really sure. I also don't think a redundant title is the worst thing in the world (so long as it looks different enough from the other titles)

Copy link
Contributor

@gabalafou gabalafou left a comment

Choose a reason for hiding this comment

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

Thanks @soapy1 for addressing my review comments!

I guess we'll find out in the next release if the docker push job works?

@soapy1 soapy1 force-pushed the add-docker-release-workflow branch from b0ec2e1 to 3d462c5 Compare January 9, 2025 18:24
@soapy1
Copy link
Contributor Author

soapy1 commented Jan 9, 2025

I guess we'll find out in the next release if the docker push job works?

I tested it out pushing images in the build-docker-image workflow. You can see the build image here https://github.com/conda-incubator/conda-store-ui/pkgs/container/conda-store-ui

@soapy1 soapy1 merged commit b202f4f into conda-incubator:main Jan 9, 2025
8 checks passed
@soapy1 soapy1 deleted the add-docker-release-workflow branch January 9, 2025 20:31
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