From 9287309ccf4adfd5ee75afad03333e01c0afd415 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 24 Nov 2023 12:36:22 +0000 Subject: [PATCH 1/2] Fix containers platforms and metadata (Add actionlint too) Signed-off-by: Pedro Algarvio --- .github/actionlint.yaml | 13 ++ .github/actions/action.yml | 33 +++++ .github/actions/setup-actionlint/action.yml | 33 +++++ .github/actions/setup-shellcheck/action.yml | 35 ++++++ .github/workflows/.container.template.j2 | 114 +++++++++++++++--- .github/workflows/almalinux-containers.yml | 114 +++++++++++++++--- .github/workflows/amazonlinux-containers.yml | 114 +++++++++++++++--- .github/workflows/archlinux-containers.yml | 114 +++++++++++++++--- .github/workflows/busybox-containers.yml | 114 +++++++++++++++--- .github/workflows/centos-containers.yml | 114 +++++++++++++++--- .../workflows/centos-stream-containers.yml | 114 +++++++++++++++--- .github/workflows/consul-containers.yml | 114 +++++++++++++++--- .github/workflows/debian-containers.yml | 114 +++++++++++++++--- .github/workflows/etcd-v2-containers.yml | 114 +++++++++++++++--- .github/workflows/etcd-v3-containers.yml | 114 +++++++++++++++--- .github/workflows/fedora-containers.yml | 114 +++++++++++++++--- .github/workflows/mariadb-containers.yml | 114 +++++++++++++++--- .github/workflows/mysql-server-containers.yml | 114 +++++++++++++++--- .../workflows/openldap-minion-containers.yml | 114 +++++++++++++++--- .github/workflows/opensuse-containers.yml | 114 +++++++++++++++--- .github/workflows/packaging-containers.yml | 114 +++++++++++++++--- .github/workflows/percona-containers.yml | 114 +++++++++++++++--- .github/workflows/photon-containers.yml | 114 +++++++++++++++--- .github/workflows/pre-commit.yml | 8 +- .github/workflows/python-containers.yml | 114 +++++++++++++++--- .github/workflows/rabbitmq-containers.yml | 114 +++++++++++++++--- .github/workflows/redis-containers.yml | 114 +++++++++++++++--- .github/workflows/salt-containers.yml | 114 +++++++++++++++--- .../workflows/salt-gitfs-http-containers.yml | 114 +++++++++++++++--- .github/workflows/ssh-minion-containers.yml | 114 +++++++++++++++--- .github/workflows/tinyproxy-containers.yml | 114 +++++++++++++++--- .github/workflows/ubuntu-containers.yml | 114 +++++++++++++++--- .github/workflows/vault-containers.yml | 114 +++++++++++++++--- .github/workflows/virt-minion-containers.yml | 114 +++++++++++++++--- .github/workflows/zookeeper-containers.yml | 114 +++++++++++++++--- .pre-commit-config.yaml | 13 ++ tasks/containers.py | 10 +- tools/__init__.py | 10 ++ tools/pre_commit.py | 49 ++++++++ 39 files changed, 3171 insertions(+), 453 deletions(-) create mode 100644 .github/actionlint.yaml create mode 100644 .github/actions/action.yml create mode 100644 .github/actions/setup-actionlint/action.yml create mode 100644 .github/actions/setup-shellcheck/action.yml create mode 100644 tools/__init__.py create mode 100644 tools/pre_commit.py diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 0000000..0cb729a --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,13 @@ +self-hosted-runner: + # Labels of self-hosted runner in array of string + labels: + - bastion + - x86_64 + - arm64 + - aarch64 + - amd64 + - repo-nightly + - repo-staging + - repo-release + - medium + - large diff --git a/.github/actions/action.yml b/.github/actions/action.yml new file mode 100644 index 0000000..6605d5d --- /dev/null +++ b/.github/actions/action.yml @@ -0,0 +1,33 @@ +--- +name: setup-actionlint +description: Setup actionlint +inputs: + version: + description: The version of actionlint + default: 1.6.24 + cache-seed: + required: true + type: string + description: Seed used to invalidate caches + +runs: + using: composite + steps: + + - name: Cache actionlint Binary + uses: actions/cache@v3 + with: + path: /usr/local/bin/actionlint + key: ${{ inputs.cache-seed }}|${{ runner.os }}|${{ runner.arch }}|actionlint|${{ inputs.version }} + + - name: Setup actionlint + shell: bash + run: | + if ! command -v actionlint; then + bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) ${{ inputs.version }} + mv ./actionlint /usr/local/bin/actionlint + fi + - name: Show actionlint Version + shell: bash + run: | + actionlint --version diff --git a/.github/actions/setup-actionlint/action.yml b/.github/actions/setup-actionlint/action.yml new file mode 100644 index 0000000..6605d5d --- /dev/null +++ b/.github/actions/setup-actionlint/action.yml @@ -0,0 +1,33 @@ +--- +name: setup-actionlint +description: Setup actionlint +inputs: + version: + description: The version of actionlint + default: 1.6.24 + cache-seed: + required: true + type: string + description: Seed used to invalidate caches + +runs: + using: composite + steps: + + - name: Cache actionlint Binary + uses: actions/cache@v3 + with: + path: /usr/local/bin/actionlint + key: ${{ inputs.cache-seed }}|${{ runner.os }}|${{ runner.arch }}|actionlint|${{ inputs.version }} + + - name: Setup actionlint + shell: bash + run: | + if ! command -v actionlint; then + bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) ${{ inputs.version }} + mv ./actionlint /usr/local/bin/actionlint + fi + - name: Show actionlint Version + shell: bash + run: | + actionlint --version diff --git a/.github/actions/setup-shellcheck/action.yml b/.github/actions/setup-shellcheck/action.yml new file mode 100644 index 0000000..8e3efda --- /dev/null +++ b/.github/actions/setup-shellcheck/action.yml @@ -0,0 +1,35 @@ +--- +name: setup-shellcheck +description: Setup shellcheck +inputs: + version: + description: The version of shellcheck + default: v0.9.0 + cache-seed: + required: true + type: string + description: Seed used to invalidate caches + +runs: + using: composite + steps: + + - name: Cache shellcheck Binary + uses: actions/cache@v3 + with: + path: /usr/local/bin/shellcheck + key: ${{ inputs.cache-seed }}|${{ runner.os }}|${{ runner.arch }}|shellcheck|${{ inputs.version }} + + - name: Setup shellcheck + shell: bash + run: | + if ! command -v shellcheck; then + wget https://github.com/koalaman/shellcheck/releases/download/${{ inputs.version }}/shellcheck-${{ inputs.version }}.${{ runner.os }}.x86_64.tar.xz + tar xf shellcheck-${{ inputs.version }}.${{ runner.os }}.x86_64.tar.xz + mv shellcheck-${{ inputs.version }}/shellcheck /usr/local/bin/shellcheck + rm -rf shellcheck-${{ inputs.version }}.${{ runner.os }}.x86_64.tar.xz shellcheck-${{ inputs.version }} + fi + - name: Show shellcheck Version + shell: bash + run: | + shellcheck --version diff --git a/.github/workflows/.container.template.j2 b/.github/workflows/.container.template.j2 index e5c1b21..3deb05a 100644 --- a/.github/workflows/.container.template.j2 +++ b/.github/workflows/.container.template.j2 @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/almalinux-containers.yml b/.github/workflows/almalinux-containers.yml index 3b5ae16..47ebeac 100644 --- a/.github/workflows/almalinux-containers.yml +++ b/.github/workflows/almalinux-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/amazonlinux-containers.yml b/.github/workflows/amazonlinux-containers.yml index b2f37dd..69d2b40 100644 --- a/.github/workflows/amazonlinux-containers.yml +++ b/.github/workflows/amazonlinux-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/archlinux-containers.yml b/.github/workflows/archlinux-containers.yml index fb929c6..f4ad3d8 100644 --- a/.github/workflows/archlinux-containers.yml +++ b/.github/workflows/archlinux-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/busybox-containers.yml b/.github/workflows/busybox-containers.yml index 3e2cdb3..7beafbd 100644 --- a/.github/workflows/busybox-containers.yml +++ b/.github/workflows/busybox-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/centos-containers.yml b/.github/workflows/centos-containers.yml index 627b6a4..01dcc23 100644 --- a/.github/workflows/centos-containers.yml +++ b/.github/workflows/centos-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/centos-stream-containers.yml b/.github/workflows/centos-stream-containers.yml index e9ede28..e462e09 100644 --- a/.github/workflows/centos-stream-containers.yml +++ b/.github/workflows/centos-stream-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/consul-containers.yml b/.github/workflows/consul-containers.yml index 8fbf101..9bb7b4d 100644 --- a/.github/workflows/consul-containers.yml +++ b/.github/workflows/consul-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/debian-containers.yml b/.github/workflows/debian-containers.yml index 8f0d881..7717c1a 100644 --- a/.github/workflows/debian-containers.yml +++ b/.github/workflows/debian-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/etcd-v2-containers.yml b/.github/workflows/etcd-v2-containers.yml index a8614b9..2556ed6 100644 --- a/.github/workflows/etcd-v2-containers.yml +++ b/.github/workflows/etcd-v2-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/etcd-v3-containers.yml b/.github/workflows/etcd-v3-containers.yml index 59ae7dc..8c68ae3 100644 --- a/.github/workflows/etcd-v3-containers.yml +++ b/.github/workflows/etcd-v3-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/fedora-containers.yml b/.github/workflows/fedora-containers.yml index bed55b6..5036838 100644 --- a/.github/workflows/fedora-containers.yml +++ b/.github/workflows/fedora-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/mariadb-containers.yml b/.github/workflows/mariadb-containers.yml index f55d95d..9ae3aff 100644 --- a/.github/workflows/mariadb-containers.yml +++ b/.github/workflows/mariadb-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/mysql-server-containers.yml b/.github/workflows/mysql-server-containers.yml index 1aa8647..06c53bb 100644 --- a/.github/workflows/mysql-server-containers.yml +++ b/.github/workflows/mysql-server-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/openldap-minion-containers.yml b/.github/workflows/openldap-minion-containers.yml index 915e13f..2756034 100644 --- a/.github/workflows/openldap-minion-containers.yml +++ b/.github/workflows/openldap-minion-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/opensuse-containers.yml b/.github/workflows/opensuse-containers.yml index 84a08e9..5094f5f 100644 --- a/.github/workflows/opensuse-containers.yml +++ b/.github/workflows/opensuse-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/packaging-containers.yml b/.github/workflows/packaging-containers.yml index 9cf7177..2dfaeb6 100644 --- a/.github/workflows/packaging-containers.yml +++ b/.github/workflows/packaging-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/percona-containers.yml b/.github/workflows/percona-containers.yml index 703c2fa..77036b0 100644 --- a/.github/workflows/percona-containers.yml +++ b/.github/workflows/percona-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/photon-containers.yml b/.github/workflows/photon-containers.yml index 06703f1..0be4355 100644 --- a/.github/workflows/photon-containers.yml +++ b/.github/workflows/photon-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 943388f..56ca522 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -9,7 +9,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-actionlint + with: + cache-seed: ${{ hashFiles('.github/**', 'tools/**') }} + - uses: ./.github/actions/setup-shellcheck + with: + cache-seed: ${{ hashFiles('.github/**', 'tools/**') }} - uses: actions/setup-python@v4 with: python-version: '3.9' diff --git a/.github/workflows/python-containers.yml b/.github/workflows/python-containers.yml index 6904d3c..5e7d84a 100644 --- a/.github/workflows/python-containers.yml +++ b/.github/workflows/python-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/rabbitmq-containers.yml b/.github/workflows/rabbitmq-containers.yml index 129f9f5..d294105 100644 --- a/.github/workflows/rabbitmq-containers.yml +++ b/.github/workflows/rabbitmq-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/redis-containers.yml b/.github/workflows/redis-containers.yml index 78a1669..025edbe 100644 --- a/.github/workflows/redis-containers.yml +++ b/.github/workflows/redis-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/salt-containers.yml b/.github/workflows/salt-containers.yml index 34fea45..4ae8f93 100644 --- a/.github/workflows/salt-containers.yml +++ b/.github/workflows/salt-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/salt-gitfs-http-containers.yml b/.github/workflows/salt-gitfs-http-containers.yml index 15589ad..e79e988 100644 --- a/.github/workflows/salt-gitfs-http-containers.yml +++ b/.github/workflows/salt-gitfs-http-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/ssh-minion-containers.yml b/.github/workflows/ssh-minion-containers.yml index 8ed056e..5943959 100644 --- a/.github/workflows/ssh-minion-containers.yml +++ b/.github/workflows/ssh-minion-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/tinyproxy-containers.yml b/.github/workflows/tinyproxy-containers.yml index f159c4f..af31a0a 100644 --- a/.github/workflows/tinyproxy-containers.yml +++ b/.github/workflows/tinyproxy-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/ubuntu-containers.yml b/.github/workflows/ubuntu-containers.yml index 5ce042c..a600ef5 100644 --- a/.github/workflows/ubuntu-containers.yml +++ b/.github/workflows/ubuntu-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/vault-containers.yml b/.github/workflows/vault-containers.yml index b46afa8..006c215 100644 --- a/.github/workflows/vault-containers.yml +++ b/.github/workflows/vault-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/virt-minion-containers.yml b/.github/workflows/virt-minion-containers.yml index 05fbfb1..5a6aea5 100644 --- a/.github/workflows/virt-minion-containers.yml +++ b/.github/workflows/virt-minion-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/zookeeper-containers.yml b/.github/workflows/zookeeper-containers.yml index 9d98d3e..87594db 100644 --- a/.github/workflows/zookeeper-containers.yml +++ b/.github/workflows/zookeeper-containers.yml @@ -31,14 +31,16 @@ concurrency: jobs: matrix-generator: - name: "Mirror Matrix Generator" + name: Generate Matrix runs-on: ubuntu-latest outputs: + tags: ${{ steps.set-matrix.outputs.tags }} + name: ${{ steps.set-matrix.outputs.name }} dockerinfo: ${{ steps.set-matrix.outputs.dockerinfo }} steps: - name: "Throttle Builds" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - name: "Fetching Repository Contents" uses: actions/checkout@v4 @@ -64,10 +66,10 @@ jobs: run: | inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} - mirror-image: + build: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" + name: "Build ${{ matrix.dockerinfo.name }}:${{ matrix.dockerinfo.tag }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -98,16 +100,18 @@ jobs: - name: "Throttle concurrent pushes" run: | - t=$(shuf -i 5-30 -n 1); echo "Sleeping $t seconds"; sleep $t + t="$(shuf -i 5-30 -n 1)"; echo "Sleeping $t seconds"; sleep "$t" - - name: "Setup DockerFile" - run: | - echo " " >> ./${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.source=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.url=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.documentation=\"https://github.com/${GITHUB_REPOSITORY}/\"" >> ${{matrix.dockerinfo.file}} - echo "LABEL org.opencontainers.image.vendor=\"Unofficial Docker Hub Mirror\"" >> ${{matrix.dockerinfo.file}} - cat ./${{matrix.dockerinfo.file}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + tags: | + type=raw,value=${{ matrix.dockerinfo.tag }} + flavor: | + latest=false - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -133,10 +137,90 @@ jobs: - name: "Build & Publish" uses: docker/build-push-action@v5 + id: build with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} - push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v3 + with: + name: digests-${{ matrix.dockerinfo.name }}-${{ matrix.dockerinfo.tag }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + name: "Merge ${{ needs.matrix-generator.outputs.name }}:${{ matrix.tag }}" + + strategy: + fail-fast: false + max-parallel: 10 + matrix: + tag: ${{ fromJson(needs.matrix-generator.outputs.tags) }} + + needs: + - matrix-generator + - build + + permissions: + actions: read + checks: write + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + + steps: + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests-${{ needs.matrix-generator.outputs.name }}-${{ matrix.tag }} + path: /tmp/digests + + - name: Show digests + run: | + tree -a /tmp/digest + cat /tmp/digests/* + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }} tags: | - ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} + type=raw,value=${{ matrix.tag }} + flavor: | + latest=false + + - name: "Log into GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create "$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ + "$(printf 'ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}@sha256:%s ' *)" + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ needs.matrix-generator.outputs.name }}:${{ steps.meta.outputs.version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4f38198..ec1ebc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,6 +29,19 @@ repos: - msgpack==1.0.3 - six==1.16.0 + - repo: https://github.com/s0undt3ch/python-tools-scripts + rev: "0.18.4" + hooks: + - id: tools + alias: actionlint + name: Lint GitHub Actions Workflows + files: "^.github/workflows/" + types: + - yaml + args: + - pre-commit + - actionlint + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: diff --git a/tasks/containers.py b/tasks/containers.py index 9641a9e..f2eb6d9 100644 --- a/tasks/containers.py +++ b/tasks/containers.py @@ -185,7 +185,9 @@ def matrix(ctx, image, from_workflow=False, build_platforms=None): utils.error(f"Failed to find a container matching path {image}") utils.exit_invoke(1) output = [] + tags = [] for fpath in mirrors_path.glob("*.Dockerfile"): + tags.append(fpath.stem) if "container" in details: source_tag = details.get("source_tag", "{version}").format(version=fpath.stem) source_container = f"{details['container']}:{source_tag}" @@ -204,7 +206,8 @@ def matrix(ctx, image, from_workflow=False, build_platforms=None): continue output.append( { - "name": f"{details['name']}:{fpath.stem}", + "name": details["name"], + "tag": fpath.stem, "platform": platform, "file": str(fpath.relative_to(utils.REPO_ROOT)), "source_container": source_container, @@ -215,7 +218,8 @@ def matrix(ctx, image, from_workflow=False, build_platforms=None): # This is because the buildx inspect did not return anything output.append( { - "name": f"{details['name']}:{fpath.stem}", + "name": details["name"], + "tag": fpath.stem, "file": str(fpath.relative_to(utils.REPO_ROOT)), "source_container": source_container, "platform": "", @@ -232,6 +236,8 @@ def matrix(ctx, image, from_workflow=False, build_platforms=None): utils.exit_invoke(1) with open(github_output, "a", encoding="utf-8") as wfh: wfh.write(f"dockerinfo={json.dumps(output)}\n") + wfh.write(f"tags={json.dumps(tags)}\n") + wfh.write(f"name={details['name']}") @task diff --git a/tools/__init__.py b/tools/__init__.py new file mode 100644 index 0000000..daa4996 --- /dev/null +++ b/tools/__init__.py @@ -0,0 +1,10 @@ +from __future__ import annotations + +import logging + +import ptscripts + +ptscripts.register_tools_module("tools.pre_commit") + +for name in ("boto3", "botocore", "urllib3"): + logging.getLogger(name).setLevel(logging.INFO) diff --git a/tools/pre_commit.py b/tools/pre_commit.py new file mode 100644 index 0000000..307b586 --- /dev/null +++ b/tools/pre_commit.py @@ -0,0 +1,49 @@ +""" +These commands are used by pre-commit. +""" +# pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated +from __future__ import annotations + +import logging +import shutil + +from ptscripts import command_group +from ptscripts import Context + +log = logging.getLogger(__name__) + +# Define the command group +cgroup = command_group(name="pre-commit", help="Pre-Commit Related Commands", description=__doc__) + + +@cgroup.command( + name="actionlint", + arguments={ + "files": { + "help": "Files to run actionlint against", + "nargs": "*", + }, + "no_color": { + "help": "Disable colors in output", + }, + }, +) +def actionlint(ctx: Context, files: list[str], no_color: bool = False): + """ + Run `actionlint` against workflows. + """ + actionlint = shutil.which("actionlint") + if not actionlint: + ctx.warn("Could not find the 'actionlint' binary") + ctx.exit(0) + cmdline = [actionlint] + if no_color is False: + cmdline.append("-color") + shellcheck = shutil.which("shellcheck") + if shellcheck: + cmdline.append(f"-shellcheck={shellcheck}") + pyflakes = shutil.which("pyflakes") + if pyflakes: + cmdline.append(f"-pyflakes={pyflakes}") + ret = ctx.run(*cmdline, *files, check=False) + ctx.exit(ret.returncode) From 8e93a6a118d61d1551bc53584f689ec9a094c51d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 24 Nov 2023 15:37:50 +0000 Subject: [PATCH 2/2] Cancel running builds Signed-off-by: Pedro Algarvio --- .github/workflows/.container.template.j2 | 9 +++------ .github/workflows/almalinux-containers.yml | 9 +++------ .github/workflows/amazonlinux-containers.yml | 9 +++------ .github/workflows/archlinux-containers.yml | 9 +++------ .github/workflows/busybox-containers.yml | 9 +++------ .github/workflows/centos-containers.yml | 9 +++------ .github/workflows/centos-stream-containers.yml | 9 +++------ .github/workflows/consul-containers.yml | 9 +++------ .github/workflows/debian-containers.yml | 9 +++------ .github/workflows/etcd-v2-containers.yml | 9 +++------ .github/workflows/etcd-v3-containers.yml | 9 +++------ .github/workflows/fedora-containers.yml | 9 +++------ .github/workflows/mariadb-containers.yml | 9 +++------ .github/workflows/mysql-server-containers.yml | 9 +++------ .github/workflows/openldap-minion-containers.yml | 9 +++------ .github/workflows/opensuse-containers.yml | 9 +++------ .github/workflows/packaging-containers.yml | 9 +++------ .github/workflows/percona-containers.yml | 9 +++------ .github/workflows/photon-containers.yml | 9 +++------ .github/workflows/python-containers.yml | 9 +++------ .github/workflows/rabbitmq-containers.yml | 9 +++------ .github/workflows/redis-containers.yml | 9 +++------ .github/workflows/salt-containers.yml | 9 +++------ .github/workflows/salt-gitfs-http-containers.yml | 9 +++------ .github/workflows/ssh-minion-containers.yml | 9 +++------ .github/workflows/tinyproxy-containers.yml | 9 +++------ .github/workflows/ubuntu-containers.yml | 9 +++------ .github/workflows/vault-containers.yml | 9 +++------ .github/workflows/virt-minion-containers.yml | 9 +++------ .github/workflows/zookeeper-containers.yml | 9 +++------ 30 files changed, 90 insertions(+), 180 deletions(-) diff --git a/.github/workflows/.container.template.j2 b/.github/workflows/.container.template.j2 index 3deb05a..1ad196e 100644 --- a/.github/workflows/.container.template.j2 +++ b/.github/workflows/.container.template.j2 @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: <{ repository_path }>-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: <{ repository_path }>-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/almalinux-containers.yml b/.github/workflows/almalinux-containers.yml index 47ebeac..b2138ac 100644 --- a/.github/workflows/almalinux-containers.yml +++ b/.github/workflows/almalinux-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/almalinux-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/almalinux-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/amazonlinux-containers.yml b/.github/workflows/amazonlinux-containers.yml index 69d2b40..ecb6097 100644 --- a/.github/workflows/amazonlinux-containers.yml +++ b/.github/workflows/amazonlinux-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/amazonlinux-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/amazonlinux-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/archlinux-containers.yml b/.github/workflows/archlinux-containers.yml index f4ad3d8..8840e68 100644 --- a/.github/workflows/archlinux-containers.yml +++ b/.github/workflows/archlinux-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/archlinux-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/archlinux-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/busybox-containers.yml b/.github/workflows/busybox-containers.yml index 7beafbd..339126e 100644 --- a/.github/workflows/busybox-containers.yml +++ b/.github/workflows/busybox-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/busybox-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/busybox-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/centos-containers.yml b/.github/workflows/centos-containers.yml index 01dcc23..89232b0 100644 --- a/.github/workflows/centos-containers.yml +++ b/.github/workflows/centos-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/centos-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/centos-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/centos-stream-containers.yml b/.github/workflows/centos-stream-containers.yml index e462e09..3bf576b 100644 --- a/.github/workflows/centos-stream-containers.yml +++ b/.github/workflows/centos-stream-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/centos-stream-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/centos-stream-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/consul-containers.yml b/.github/workflows/consul-containers.yml index 9bb7b4d..57be46d 100644 --- a/.github/workflows/consul-containers.yml +++ b/.github/workflows/consul-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/consul-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/consul-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/debian-containers.yml b/.github/workflows/debian-containers.yml index 7717c1a..195ef83 100644 --- a/.github/workflows/debian-containers.yml +++ b/.github/workflows/debian-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/debian-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/debian-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/etcd-v2-containers.yml b/.github/workflows/etcd-v2-containers.yml index 2556ed6..fb85c22 100644 --- a/.github/workflows/etcd-v2-containers.yml +++ b/.github/workflows/etcd-v2-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/etcd-v2-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/etcd-v2-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/etcd-v3-containers.yml b/.github/workflows/etcd-v3-containers.yml index 8c68ae3..961f910 100644 --- a/.github/workflows/etcd-v3-containers.yml +++ b/.github/workflows/etcd-v3-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/etcd-v3-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/etcd-v3-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/fedora-containers.yml b/.github/workflows/fedora-containers.yml index 5036838..a7eed74 100644 --- a/.github/workflows/fedora-containers.yml +++ b/.github/workflows/fedora-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/fedora-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/fedora-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/mariadb-containers.yml b/.github/workflows/mariadb-containers.yml index 9ae3aff..b629545 100644 --- a/.github/workflows/mariadb-containers.yml +++ b/.github/workflows/mariadb-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/mariadb-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/mariadb-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/mysql-server-containers.yml b/.github/workflows/mysql-server-containers.yml index 06c53bb..2b428a0 100644 --- a/.github/workflows/mysql-server-containers.yml +++ b/.github/workflows/mysql-server-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/mysql-server-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/mysql-server-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/openldap-minion-containers.yml b/.github/workflows/openldap-minion-containers.yml index 2756034..7c5a9ce 100644 --- a/.github/workflows/openldap-minion-containers.yml +++ b/.github/workflows/openldap-minion-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: custom/openldap-minion-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: custom/openldap-minion-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/opensuse-containers.yml b/.github/workflows/opensuse-containers.yml index 5094f5f..7a63003 100644 --- a/.github/workflows/opensuse-containers.yml +++ b/.github/workflows/opensuse-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/opensuse-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/opensuse-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/packaging-containers.yml b/.github/workflows/packaging-containers.yml index 2dfaeb6..c47e9c7 100644 --- a/.github/workflows/packaging-containers.yml +++ b/.github/workflows/packaging-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: custom/packaging-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: custom/packaging-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/percona-containers.yml b/.github/workflows/percona-containers.yml index 77036b0..17cbb52 100644 --- a/.github/workflows/percona-containers.yml +++ b/.github/workflows/percona-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/percona-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/percona-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/photon-containers.yml b/.github/workflows/photon-containers.yml index 0be4355..1314bdd 100644 --- a/.github/workflows/photon-containers.yml +++ b/.github/workflows/photon-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/photon-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/photon-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/python-containers.yml b/.github/workflows/python-containers.yml index 5e7d84a..6eaa250 100644 --- a/.github/workflows/python-containers.yml +++ b/.github/workflows/python-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/python-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/python-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/rabbitmq-containers.yml b/.github/workflows/rabbitmq-containers.yml index d294105..adc3cf5 100644 --- a/.github/workflows/rabbitmq-containers.yml +++ b/.github/workflows/rabbitmq-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/rabbitmq-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/rabbitmq-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/redis-containers.yml b/.github/workflows/redis-containers.yml index 025edbe..ba80a6c 100644 --- a/.github/workflows/redis-containers.yml +++ b/.github/workflows/redis-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/redis-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/redis-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/salt-containers.yml b/.github/workflows/salt-containers.yml index 4ae8f93..8540753 100644 --- a/.github/workflows/salt-containers.yml +++ b/.github/workflows/salt-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: salt-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: salt-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/salt-gitfs-http-containers.yml b/.github/workflows/salt-gitfs-http-containers.yml index e79e988..e644aad 100644 --- a/.github/workflows/salt-gitfs-http-containers.yml +++ b/.github/workflows/salt-gitfs-http-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: custom/salt-gitfs-http-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: custom/salt-gitfs-http-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/ssh-minion-containers.yml b/.github/workflows/ssh-minion-containers.yml index 5943959..fe4301b 100644 --- a/.github/workflows/ssh-minion-containers.yml +++ b/.github/workflows/ssh-minion-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: custom/ssh-minion-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: custom/ssh-minion-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/tinyproxy-containers.yml b/.github/workflows/tinyproxy-containers.yml index af31a0a..62912fb 100644 --- a/.github/workflows/tinyproxy-containers.yml +++ b/.github/workflows/tinyproxy-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/tinyproxy-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/tinyproxy-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/ubuntu-containers.yml b/.github/workflows/ubuntu-containers.yml index a600ef5..f763b3c 100644 --- a/.github/workflows/ubuntu-containers.yml +++ b/.github/workflows/ubuntu-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/ubuntu-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/ubuntu-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/vault-containers.yml b/.github/workflows/vault-containers.yml index 006c215..fae3390 100644 --- a/.github/workflows/vault-containers.yml +++ b/.github/workflows/vault-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/vault-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/vault-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/virt-minion-containers.yml b/.github/workflows/virt-minion-containers.yml index 5a6aea5..7028d40 100644 --- a/.github/workflows/virt-minion-containers.yml +++ b/.github/workflows/virt-minion-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: custom/virt-minion-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: custom/virt-minion-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/.github/workflows/zookeeper-containers.yml b/.github/workflows/zookeeper-containers.yml index 87594db..6798e46 100644 --- a/.github/workflows/zookeeper-containers.yml +++ b/.github/workflows/zookeeper-containers.yml @@ -22,11 +22,8 @@ env: concurrency: - # Concurrency is defined in a way that concurrent builds against branches do - # not cancel previous builds. - # However, for every new build against the same pull request source branch, - # all older builds against that same branch get canceled. - group: mirrors/zookeeper-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }} + # New builds always cancel previous, still running, builds + group: mirrors/zookeeper-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -143,7 +140,7 @@ jobs: context: ${{ env.PATH_IN_REPO }} platforms: ${{ matrix.dockerinfo.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }}:${{ steps.meta.outputs.version }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: |