forked from Narcissus/docker-multi-platform-probe
All checks were successful
Build and push / Build and push (map[name:systemec_piraeus registry:piraeus.systemec.nl]) (push) Successful in 5m12s
86 lines
2.2 KiB
YAML
86 lines
2.2 KiB
YAML
# See https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
|
|
|
|
name: Build and push # to docker registries
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
tags:
|
|
- "*"
|
|
release:
|
|
types: [published]
|
|
|
|
env:
|
|
IMAGE_NAME: prtgprobe/multi-platform-probe
|
|
|
|
jobs:
|
|
docker_build:
|
|
name: Build and push
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
packages: write
|
|
contents: read
|
|
attestations: write
|
|
id-token: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
variant:
|
|
- name: systemec_piraeus
|
|
registry: "piraeus.systemec.nl"
|
|
steps:
|
|
- name: Set image for Docker
|
|
id: set-image
|
|
run: |
|
|
if [ "${{ matrix.variant.name }}" == "systemec_piraeus" ]; then
|
|
echo "IMAGE_TO_USE=${IMAGE_NAME}" >> $GITHUB_ENV
|
|
else
|
|
echo "Failing to resolve."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Check out the repository
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
with:
|
|
platforms: |
|
|
- linux/amd64
|
|
- linux/arm64
|
|
- linux/arm/v7
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Systemec Piraeus
|
|
if: matrix.variant.name == 'systemec_piraeus'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
|
|
registry: ${{ matrix.variant.registry }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ matrix.variant.registry }}/${{ env.IMAGE_TO_USE }}
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=ref,event=tag
|
|
type=sha,format=short,prefix=
|
|
|
|
- name: Build and push Docker image
|
|
id: push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|