Skip to content

Update build and push workflow#67

Merged
sgibson91 merged 6 commits intomainfrom
update_build
Jul 25, 2025
Merged

Update build and push workflow#67
sgibson91 merged 6 commits intomainfrom
update_build

Conversation

@JimMadge
Copy link
Member

@JimMadge JimMadge commented Jul 2, 2025

Some tidying and updating of the build/push behaviour for container images on ghcr. Inspired by wanting to pin specific version in our actions, see #66.

Should automate tagging container images with suitable version tags, which we can then use in the action to help people stick to a particular release of the code.
This should make the syncing between action version and container version easier.

@sgibson91
Copy link
Member

You realise this won't keep the action and container version in sync at all because it doesn't do anything to the action.yaml file right? (Not against the changes at all, just wanting to make sure we share understanding of what's actually happening)

@JimMadge
Copy link
Member Author

JimMadge commented Jul 5, 2025

You realise this won't keep the action and container version in sync at all because it doesn't do anything to the action.yaml file right? (Not against the changes at all, just wanting to make sure we share understanding of what's actually happening)

Yep that is right. It automates the tagging of container images with labels taken from a git tag. But it doesn't do anything to make sure those tags are correct or in sync with action.yaml.

uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
Copy link
Member

@sgibson91 sgibson91 Jul 5, 2025

Choose a reason for hiding this comment

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

FYI, this will work now we're in the-turing-way org, but the reason I had the "downcase" step above is because the push to ghcr will fail if there are capital letters in the image name. Rachael had capital letters in her GitHub handle, which is why I added the step.

Is it worth keeping this lower casing logic somewhere just so the workflow is robust to any future org/repo name changes? Doesn't have to be in exactly the same form I had above.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, good knowledge. I wouldn't have guessed that.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would say remove it as it isn't necessary, less to maintain and no risk of confusion.

@JimMadge JimMadge self-assigned this Jul 21, 2025
@JimMadge JimMadge requested a review from sgibson91 July 25, 2025 10:13
@sgibson91 sgibson91 merged commit eea9217 into main Jul 25, 2025
4 checks passed
@sgibson91 sgibson91 deleted the update_build branch July 25, 2025 13:24
@sgibson91
Copy link
Member

Hmmmm, build failed https://github.com/the-turing-way/all-all-contributors/actions/runs/16523079997/job/46729361897

I'm about to go into a meeting so can't debug right this second

@JimMadge
Copy link
Member Author

JimMadge commented Jul 26, 2025

Error: buildx failed with: ERROR: failed to build: tag is needed when pushing to registry

So something isn't going right with passing the tags to the build action.

From the metadata action,

 {
    "target": {
      "docker-metadata-action": {
        "tags": [
          "ghcr.io/the-turing-way/all-all-contributors:edge",
          "ghcr.io/the-turing-way/all-all-contributors:sha-eea9217"
        ],
        "args": {
          "DOCKER_META_IMAGES": "ghcr.io/the-turing-way/all-all-contributors",
          "DOCKER_META_VERSION": "edge"
        }
      }
    }
  }

The tags are being generated, but I don't think that is doing quite what we want. I thought the edge thing would create a tag called main.

@sgibson91
Copy link
Member

sgibson91 commented Jul 31, 2025

@JimMadge PR #69 got us a tag called main, but the push is still failing due to the same error that you found

Error: buildx failed with: ERROR: failed to build: tag is needed when pushing to registry
  {
    "target": {
      "docker-metadata-action": {
        "tags": [
          "ghcr.io/the-turing-way/all-all-contributors:main",
          "ghcr.io/the-turing-way/all-all-contributors:sha-6769416"
        ],
        "args": {
          "DOCKER_META_IMAGES": "ghcr.io/the-turing-way/all-all-contributors",
          "DOCKER_META_VERSION": "main"
        }
      }
    }
  }

@JimMadge
Copy link
Member Author

JimMadge commented Aug 1, 2025

Yep, sorry. It isn't obvious to me what is wrong so I need to find some time to debug this 😅

@sgibson91
Copy link
Member

Oh yeah, me neither. I just took some opportunistic time last night to have a look myself 😄

@RayStick
Copy link
Contributor

@all-contributors add @JimMadge for infrastructure

@allcontributors
Copy link
Contributor

@RayStick

I've put up a pull request to add @JimMadge! 🎉

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.

3 participants