Publish the images #32
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish the images | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: write | |
env: | |
REGISTRY_IMAGE_PREFIX: "quay.io/giskard/" | |
jobs: | |
build: | |
strategy: | |
matrix: | |
version: ["3.12", "3.13"] | |
platform: ['ubuntu-latest', 'runner-ubuntu24-arm64'] | |
fail-fast: false | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Set up Docker Buildx | |
id: builder | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.REGISTRY_IMAGE_PREFIX }}python | |
flavor: | | |
latest=false | |
tags: | | |
type=raw,enable=true,value=${{ matrix.version }}-${{ matrix.platform }} | |
- name: Login to Docker registry | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
- name: Push | |
id: push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./python | |
file: ./python/Dockerfile_${{ matrix.version }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
builder: ${{ steps.builder.outputs.name }} | |
push: true | |
# For details, see link below | |
# https://docs.docker.com/build/ci/github-actions/multi-platform/ | |
- name: Export digest | |
run: | | |
mkdir -p /tmp/digests/${{ matrix.version }} | |
digest="${{ steps.push.outputs.digest }}" | |
touch "/tmp/digests/${{ matrix.version }}/${digest#sha256:}" | |
- name: Upload digest | |
uses: actions/upload-artifact@v4 | |
with: | |
name: digests-${{ matrix.version }}-${{ matrix.platform }} | |
path: /tmp/digests/${{ matrix.version }}/* | |
if-no-files-found: error | |
retention-days: 1 | |
merge: | |
strategy: | |
matrix: | |
version: ["3.12", "3.13"] | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: Download digests | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: digests-${{ matrix.version }}-* | |
merge-multiple: true | |
path: /tmp/digests/${{ matrix.version }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
tags: | | |
type=raw,value=${{ matrix.version }} | |
images: | | |
${{ env.REGISTRY_IMAGE_PREFIX }}python | |
flavor: | | |
latest=false | |
- name: Login to Docker registry | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
- name: Create manifest list and push | |
working-directory: /tmp/digests/${{ matrix.version }} | |
run: | | |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | |
$(printf '${{ env.REGISTRY_IMAGE_PREFIX }}python@sha256:%s ' *) | |
- name: Inspect image | |
run: | | |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE_PREFIX }}python:${{ steps.meta.outputs.version }} |