1
0
mirror of https://github.com/pi-hole/docker-pi-hole.git synced 2024-07-15 20:24:15 +02:00
docker-pi-hole/.github/actions/merge-and-push/action.yml
Adam Warner 2e5998175b
Yolo
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-06-19 22:44:22 +01:00

48 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Merge and push
description: Apply meta, create manifest, and push to container registry
inputs:
imagename:
required: true
description: The name of the image to push
platform:
required: true
description: The platform to push the image for
runs:
using: "composite"
steps:
-
name: Docker meta
id: meta_docker
uses: docker/metadata-action@v4
with:
images: |
${{ inputs.imagename }},enable=${{ github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' }}
foo/bar,enable=${{ github.event_name == 'pull_request' }}
# We want to tag the image with the latest tag if the workflow was triggered by a tag
flavor: |
latest=${{ startsWith(github.ref, 'refs/tags/') }}
# tags:
# type=schedule means that a tag is applied when the workflow is triggered by a schedule event
# type=ref,event=branch means that a tag is applied when the workflow is triggered by a push to a branch
# type=ref,event=tag means that a tag is applied when the workflow is triggered by a push to a tag
tags: |
type=schedule,suffix=-${{ inputs.platform }},enable=${{ github.event_name == 'schedule' }}
type=ref,event=branch,suffix=-${{ inputs.platform }},enable=${{ github.event_name != 'schedule' }}
type=ref,event=tag,suffix=-${{ inputs.platform }}
-
name: Create manifest list and push to repository
working-directory: /tmp/digests/dockerhub/${{ inputs.platform }}
# When using composite actions, you have to specify the shell. As you
# dont specify a runner type in composite actions, you need to specify
# the shell instead for each action.
shell: bash
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ inputs.imagename }}@sha256:%s ' *)
-
name: Inspect image
shell: bash
run: |
docker buildx imagetools inspect ${{ inputs.imagename }}:${{ steps.meta_docker.outputs.version }}