-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #319 from detiber/multiRegistry
ππ»ββοΈ Publish images to multiple registries
- Loading branch information
Showing
4 changed files
with
214 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: 'Metadata' | ||
description: 'Generate Image Metadata' | ||
inputs: | ||
docker_username: | ||
description: 'docker_username' | ||
required: true | ||
quay_username: | ||
description: 'quay_username' | ||
required: true | ||
metadata_flavor: | ||
description: 'metadata_flavor' | ||
required: true | ||
metadata_tags: | ||
description: 'metadata_tags' | ||
required: true | ||
outputs: | ||
tags: | ||
description: "generated image tags" | ||
value: ${{ steps.meta.outputs.tags }} | ||
labels: | ||
description: "generated image labels" | ||
value: ${{ steps.meta.outputs.labels }} | ||
version: | ||
description: "generated image version" | ||
value: ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Build image urls | ||
shell: bash | ||
id: image-urls | ||
env: | ||
DOCKER_USERNAME: ${{ inputs.docker_username }} | ||
QUAY_USERNAME: ${{ inputs.quay_username }} | ||
run: | | ||
IMAGES=${GHCR_REGISTRY}/${IMAGE_NAME} | ||
[[ -n "$DOCKER_USERNAME" ]] && IMAGES=${IMAGES},${DOCKER_REGISTRY}/${IMAGE_NAME} | ||
[[ -n "$QUAY_USERNAME" ]] && IMAGES=${IMAGES},${QUAY_REGISTRY}/${IMAGE_NAME} | ||
echo "::set-output name=images::${IMAGES}" | ||
- name: Docker manager metadata | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ steps.image-urls.outputs.images }} | ||
flavor: ${{ inputs.metadata_flavor }} | ||
tags: ${{ inputs.metadata_tags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.