Skip to content

0.3.3

0.3.3 #18

Workflow file for this run

name: Python package
on:
push:
tags:
- "v*.*.*"
env:
REGISTRY_IMAGE: holisticon/bpm-ai-inference
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Publish python poetry package
uses: JRubics/[email protected]
with:
python_version: "3.11"
pypi_token: ${{ secrets.PYPI_TOKEN }}
# Install project without developer requirements.
ignore_dev_requirements: "yes"
build-push:
strategy:
matrix:
include:
- arch: amd64
- arch: arm64
runs-on: ubuntu-latest
outputs:
image: ${{ steps.image.outputs.image }}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- run: docker context create builders
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
endpoint: builders
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get the version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
- name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/${{ matrix.arch }}
provenance: false # otherwise a manifest list is created and create-push-manifest job fails
context: .
file: ./Dockerfile
build-args: |
PYTHON_VERSION=3.11
push: true
tags: |
${{ env.REGISTRY_IMAGE }}:${{ steps.vars.outputs.tag }}-cpu-${{ matrix.arch }}
${{ env.REGISTRY_IMAGE }}:latest-cpu-${{ matrix.arch }}
- id: image
run: echo "::set-output name=image::$(echo ${{ env.REGISTRY_IMAGE }}:latest-cpu)"
create-push-manifest:
runs-on: ubuntu-latest
needs: [build-push]
steps:
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Get version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
-
name: Create version-manifest and push
run: |
docker manifest create \
${{ env.REGISTRY_IMAGE }}:${{ steps.vars.outputs.tag }}-cpu \
--amend ${{ env.REGISTRY_IMAGE }}:${{ steps.vars.outputs.tag }}-cpu-amd64 \
--amend ${{ env.REGISTRY_IMAGE }}:${{ steps.vars.outputs.tag }}-cpu-arm64
docker manifest push ${{ env.REGISTRY_IMAGE }}:${{ steps.vars.outputs.tag }}-cpu
-
name: Create latest-manifest and push
run: |
docker manifest create \
${{ env.REGISTRY_IMAGE }}:latest-cpu \
--amend ${{ env.REGISTRY_IMAGE }}:latest-cpu-amd64 \
--amend ${{ env.REGISTRY_IMAGE }}:latest-cpu-arm64
docker manifest push ${{ env.REGISTRY_IMAGE }}:latest-cpu