Skip to content

Bump pytest from 8.2.0 to 8.2.1 (#233) #225

Bump pytest from 8.2.0 to 8.2.1 (#233)

Bump pytest from 8.2.0 to 8.2.1 (#233) #225

name: Docker Image
on:
push:
branches:
- master
tags:
- "*.*.*"
jobs:
buildx:
runs-on: ubuntu-latest
#strategy:
# fail-fast: false
# max-parallel: 2
# matrix:
# # Not all for time waste reasons
# platform: [ "linux/arm64", "linux/amd64" ]
steps:
- name: Checkout
uses: actions/checkout@v4
# this writes the tag name into GIT_TAG_NAME
- name: Get tag name
uses: little-core-labs/get-git-tag@v3.0.2
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
#with:
# install: true
- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Prepare
id: prepare
run: |
DOCKER_IMAGE=markusressel/barcode-server
# compare with support in base image: https://hub.docker.com/_/python
# orjson only supports 64bit variants, see: https://github.com/ijl/orjson
DOCKER_PLATFORMS=linux/amd64,linux/arm64
VERSION=latest
TAGS="--tag ${DOCKER_IMAGE}:${VERSION}"
if [[ $GIT_TAG_NAME =~ ^v?[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
VERSION=${GIT_TAG_NAME}
TAGS="$TAGS --tag ${DOCKER_IMAGE}:${VERSION}"
fi
echo ::set-output name=docker_image::${DOCKER_IMAGE}
echo ::set-output name=version::${VERSION}
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
--build-arg VERSION=${VERSION} \
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg VCS_REF=${GITHUB_SHA::8} \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
${TAGS} --file Dockerfile .
- name: Cache Docker layers
uses: actions/cache@v4
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build
run: |
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}