[enh] container: support multiple registries
Allows to push the manifests to other registries, this allows to push both docker.io and ghcr.io registries.
This commit is contained in:
parent
da3c640cef
commit
d2bb7cdb96
17
.github/workflows/container.yml
vendored
17
.github/workflows/container.yml
vendored
@ -117,10 +117,6 @@ jobs:
|
||||
os: ubuntu-24.04-arm
|
||||
emulation: true
|
||||
|
||||
permissions:
|
||||
# Organization GHCR
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@ -152,15 +148,17 @@ jobs:
|
||||
- build
|
||||
- test
|
||||
|
||||
permissions:
|
||||
# Organization GHCR
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- if: env.DOCKERHUB_USERNAME != null
|
||||
name: Checkout
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: "false"
|
||||
|
||||
- if: env.DOCKERHUB_USERNAME != null
|
||||
name: Login to GHCR
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: "ghcr.io"
|
||||
@ -175,8 +173,7 @@ jobs:
|
||||
username: "${{ env.DOCKERHUB_USERNAME }}"
|
||||
password: "${{ secrets.DOCKERHUB_TOKEN }}"
|
||||
|
||||
- if: env.DOCKERHUB_USERNAME != null
|
||||
name: Release
|
||||
- name: Release
|
||||
env:
|
||||
GIT_URL: "${{ needs.build.outputs.git_url }}"
|
||||
DOCKER_TAG: "${{ needs.build.outputs.docker_tag }}"
|
||||
|
@ -272,8 +272,7 @@ container.push() {
|
||||
done
|
||||
|
||||
# Manifest tags
|
||||
release_tags=("latest")
|
||||
release_tags+=("$DOCKER_TAG")
|
||||
release_tags=("latest" "$DOCKER_TAG")
|
||||
|
||||
# Create manifests
|
||||
for tag in "${release_tags[@]}"; do
|
||||
@ -291,13 +290,18 @@ container.push() {
|
||||
|
||||
podman image list
|
||||
|
||||
# Remote registries
|
||||
release_registries=("ghcr.io" "docker.io")
|
||||
|
||||
# Push manifests
|
||||
for registry in "${release_registries[@]}"; do
|
||||
for tag in "${release_tags[@]}"; do
|
||||
build_msg CONTAINER "Pushing manifest with tag: $tag"
|
||||
build_msg CONTAINER "Pushing manifest $tag to $registry"
|
||||
|
||||
podman manifest push \
|
||||
"localhost/$CONTAINER_IMAGE_ORGANIZATION/$CONTAINER_IMAGE_NAME:$tag" \
|
||||
"docker://docker.io/$CONTAINER_IMAGE_ORGANIZATION/$CONTAINER_IMAGE_NAME:$tag"
|
||||
"docker://$registry/$CONTAINER_IMAGE_ORGANIZATION/$CONTAINER_IMAGE_NAME:$tag"
|
||||
done
|
||||
done
|
||||
)
|
||||
dump_return $?
|
||||
|
Loading…
x
Reference in New Issue
Block a user