diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2023-01-31 10:40:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-31 10:40:05 -0500 |
commit | 89500eb54402058461ef5cc8f4a0a58fc2ed20bc (patch) | |
tree | ef100b15e9ccf51a6fe45fcd6df4fa9a7993f0fc /.github | |
parent | b7bead6e03a3b647b0755353f8f706c1bd6e0c5d (diff) |
Fix publishing Docker Images to secondary registries. (#14389)
Diffstat (limited to '.github')
-rwxr-xr-x | .github/scripts/gen-docker-tags.py | 13 | ||||
-rw-r--r-- | .github/workflows/docker.yml | 17 |
2 files changed, 22 insertions, 8 deletions
diff --git a/.github/scripts/gen-docker-tags.py b/.github/scripts/gen-docker-tags.py index df4dc02635..8c88d3b5e6 100755 --- a/.github/scripts/gen-docker-tags.py +++ b/.github/scripts/gen-docker-tags.py @@ -6,9 +6,14 @@ version = sys.argv[1].split('.') suffix = sys.argv[2] REPO = f'netdata/netdata{suffix}' +GHCR = f'ghcr.io/{REPO}' +QUAY = f'quay.io/{REPO}' -MAJOR = ':'.join([REPO, version[0]]) -MINOR = ':'.join([REPO, '.'.join(version[0:2])]) -PATCH = ':'.join([REPO, '.'.join(version[0:3])]) +tags = [] -print(','.join([MAJOR, MINOR, PATCH])) +for repo in [REPO, GHCR, QUAY]: + tags.append(':'.join([repo, version[0]])) + tags.append(':'.join([repo, '.'.join(version[0:2])])) + tags.append(':'.join([repo, '.'.join(version[0:3])])) + +print(','.join(tags)) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 973f309c02..2d0c7698a5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -151,13 +151,13 @@ jobs: id: release-tags if: github.event.inputs.version != 'nightly' run: | - echo "tags=netdata/netdata:latest,netdata/netdata:stable,$(.github/scripts/gen-docker-tags.py ${{ needs.normalize-tag.outputs.tag }} '')" \ + echo "tags=netdata/netdata:latest,netdata/netdata:stable,ghcr.io/netdata/netdata:latest,ghcr.io/netdata/netdata:stable,quay.io/netdata/netdata:latest,quay.io/netdata/netdata:stable,$(.github/scripts/gen-docker-tags.py ${{ needs.normalize-tag.outputs.tag }} '')" \ >> "${GITHUB_ENV}" - name: Determine which tags to use id: nightly-tags if: github.event.inputs.version == 'nightly' run: | - echo "tags=netdata/netdata:latest,netdata/netdata:edge" >> "${GITHUB_ENV}" + echo "tags=netdata/netdata:latest,netdata/netdata:edge,ghcr.io/netdata/netdata:latest,ghcr.io/netdata/netdata:edge,quay.io/netdata/netdata:latest,quay.io/netdata/netdata:edge" >> "${GITHUB_ENV}" - name: Mark image as official id: env if: github.repository == 'netdata/netdata' @@ -254,13 +254,13 @@ jobs: id: release-tags if: github.event.inputs.version != 'nightly' run: | - echo "tags=netdata/netdata-debug:latest,netdata/netdata-debug:stable,$(.github/scripts/gen-docker-tags.py ${{ needs.normalize-tag.outputs.tag }} '-debug')" \ + echo "tags=netdata/netdata:latest,netdata/netdata:stable,ghcr.io/netdata/netdata:latest,ghcr.io/netdata/netdata:stable,quay.io/netdata/netdata:latest,quay.io/netdata/netdata:stable,$(.github/scripts/gen-docker-tags.py ${{ needs.normalize-tag.outputs.tag }} '')" \ >> "${GITHUB_ENV}" - name: Determine which tags to use id: nightly-tags if: github.event.inputs.version == 'nightly' run: | - echo "tags=netdata/netdata-debug:latest,netdata/netdata-debug:edge" >> "${GITHUB_ENV}" + echo "tags=netdata/netdata:latest,netdata/netdata:edge,ghcr.io/netdata/netdata:latest,ghcr.io/netdata/netdata:edge,quay.io/netdata/netdata:latest,quay.io/netdata/netdata:edge" >> "${GITHUB_ENV}" - name: Mark image as official id: env if: github.repository == 'netdata/netdata' @@ -286,6 +286,14 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Quay.io Login + id: quay-login + if: github.repository == 'netdata/netdata' + uses: docker/login-action@v2 + with: + registry: quay.io + username: ${{ secrets.NETDATABOT_QUAY_USERNAME }} + password: ${{ secrets.NETDATABOT_QUAY_TOKEN }} - name: Docker Build id: build uses: docker/build-push-action@v3 @@ -314,6 +322,7 @@ jobs: Setup buildx: ${{ steps.buildx.outcome }} Login to DockerHub: ${{ steps.docker-hub-login.outcome }} Login to GHCR: ${{ steps.ghcr-login.outcome }} + Login to Quay: ${{ steps.quay-login.outcome }} Build and publish images: ${{ steps.build.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: >- |