From edfada8cb3547f008cb89a04f89ae1a7126ca219 Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani <45800463+rchincha@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:20:58 -0800 Subject: [PATCH] ci: add a job to sync 3rd party container images (#546) Signed-off-by: Ramkumar Chinchani --- .github/workflows/sync-3rdparty-images.yaml | 35 +++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/sync-3rdparty-images.yaml diff --git a/.github/workflows/sync-3rdparty-images.yaml b/.github/workflows/sync-3rdparty-images.yaml new file mode 100644 index 00000000..29e13ebf --- /dev/null +++ b/.github/workflows/sync-3rdparty-images.yaml @@ -0,0 +1,35 @@ +name: 'Sync images and artifacts to ghcr' +on: + schedule: + - cron: '30 1 * * *' + push: + branches: + - main + workflow_dispatch: + +permissions: read-all + +jobs: + sync: + name: "images" + permissions: + contents: read + packages: write + runs-on: ubuntu-latest + steps: + - name: Log in to GitHub Docker Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Tag and push to ghcr + run: | + set -e + for n in ubuntu:latest alpine:edge centos:latest busybox:latest; do + dest="${{ github.repository_owner }}/$n" + docker trust inspect "$n" + docker pull $n + docker tag $n "$dest" + docker push $dest + done