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
31 changes: 14 additions & 17 deletions .github/workflows/_docker-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Docker Publish
on:
workflow_call:
inputs:
version:
description: Release version (e.g., 1.0.0)
required: true
type: string
registry:
description: Container registry
type: string
Expand Down Expand Up @@ -34,32 +38,25 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ inputs.registry }}/${{ inputs.image_name }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

- name: Download image artifact
uses: actions/download-artifact@v4
with:
name: docker-image

- name: Load and tag image
env:
REGISTRY: ${{ inputs.registry }}
IMAGE_NAME: ${{ inputs.image_name }}
VERSION: ${{ inputs.version }}
run: |
docker load -i farm-image.tar
# Get the loaded image ID
LOADED_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" | head -1)
# Tag with all required tags
echo "${{ steps.meta.outputs.tags }}" | while read tag; do
[ -n "$tag" ] && docker tag "$LOADED_IMAGE" "$tag"
done
docker tag "$LOADED_IMAGE" "$REGISTRY/$IMAGE_NAME:$VERSION"

- name: Push image
env:
REGISTRY: ${{ inputs.registry }}
IMAGE_NAME: ${{ inputs.image_name }}
VERSION: ${{ inputs.version }}
run: |
echo "${{ steps.meta.outputs.tags }}" | while read tag; do
[ -n "$tag" ] && docker push "$tag"
done
docker push "$REGISTRY/$IMAGE_NAME:$VERSION"
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
name: Publish Docker
needs: [e2e]
uses: ./.github/workflows/_docker-publish.yaml
with:
version: ${{ needs.determine-version.outputs.version }}
secrets: inherit

publish-helm:
Expand Down