Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/actions/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Tag Docker image
description: Tag an existing Docker image on GHCR with an additional tag

inputs:
repo:
description: Repository of the image to tag
default: ghcr.io/${{ github.repository }}
required: false
source:
description: The source tag to use
required: true
target:
description: The target tag to create
required: true

runs:
using: "composite"
steps:
- name: tag
shell: bash
run: docker buildx imagetools create --tag ${{ inputs.repo }}:${{ inputs.target }} ${{ inputs.repo }}:${{ inputs.source }}
30 changes: 21 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:

env:
UV_VERSION: 0.8.14
GHCR_IMAGE_REPOSITORY: ghcr.io/${{ github.repository }}
PLATFORMS: linux/amd64,linux/arm64/v8

jobs:
Expand All @@ -28,7 +27,8 @@ jobs:
- variant: trixie
is_default_variant: true
env:
GIT_SHA_TAG: ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ github.sha }}-${{ matrix.python }}-${{ matrix.variant }}
GIT_SHA_TAG: ${{ github.sha }}-${{ matrix.python }}-${{ matrix.variant }}

steps:
- uses: actions/checkout@v4.1.4
- uses: docker/login-action@v3.1.0
Expand All @@ -38,16 +38,28 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: tag ${{ matrix.python }}-${{ matrix.variant }}
run: docker buildx imagetools create --tag ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ matrix.python }}-${{ matrix.variant }} $GIT_SHA_TAG
uses: ./.github/actions/tag
with:
source: ${{ env.GIT_SHA_TAG }}
target: ${{ matrix.python }}-${{ matrix.variant }}

- if: matrix.is_default_variant
name: tag for default variant (${{ matrix.python }})
run: docker buildx imagetools create --tag ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ matrix.python }} $GIT_SHA_TAG
name: tag ${{ matrix.python }} (default variant)
uses: ./.github/actions/tag
with:
source: ${{ env.GIT_SHA_TAG }}
target: ${{ matrix.python }}

- if: matrix.is_default_python
name: tag for default python (${{ matrix.variant }})
run: docker buildx imagetools create --tag ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ matrix.variant }} $GIT_SHA_TAG
name: tag ${{ matrix.variant }} (default python)
uses: ./.github/actions/tag
with:
source: ${{ env.GIT_SHA_TAG }}
target: ${{ matrix.variant }}

- if: matrix.is_default_python && matrix.is_default_variant
name: tag for default python and variant (latest)
run: docker buildx imagetools create --tag ${{ env.GHCR_IMAGE_REPOSITORY }}:latest $GIT_SHA_TAG
name: tag latest (default python and variant)
uses: ./.github/actions/tag
with:
source: ${{ env.GIT_SHA_TAG }}
target: latest