Skip to content

Adding CRON for python update (#7) #16

Adding CRON for python update (#7)

Adding CRON for python update (#7) #16

Workflow file for this run

name: Publish the images
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
env:
REGISTRY_IMAGE_PREFIX: "quay.io/giskard/"
jobs:
build:
strategy:
matrix:
element: ["python"]
platform: ['amd64', 'arm64']
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Docker Buildx
id: builder
uses: docker/setup-buildx-action@v3
- name: 'Append ARM buildx builder'
if: ${{ matrix.platform == 'arm64' }}
uses: baschny/append-buildx-action@v1
with:
node_name: builder-${{github.run_id}}-${{github.job}}-${{github.run_number}}-${{github.run_attempt}}
builder: ${{ steps.builder.outputs.name }}
endpoint: ssh://${{ secrets.ARM_SSH_CONNECTION_STRING }}
ssh_private_key: ${{ secrets.ARM_SSH_PRIVATE_KEY }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY_IMAGE_PREFIX }}${{ matrix.element }}
flavor: |
latest=false
tags: |
type=raw,enable=true,value=${{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: ./${{ matrix.element }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
builder: ${{ steps.builder.outputs.name }}
platforms: |
linux/${{ matrix.platform }}
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
digest="${{ steps.push.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ matrix.platform }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
pattern: digests-*
merge-multiple: true
path: /tmp/digests
- name: Set up Docker Buildx
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=${{ github.ref_name == 'main'}}
- 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
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 }}