Skip to content

Commit

Permalink
ci: add a job to sync 3rd party container images (#546)
Browse files Browse the repository at this point in the history
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
  • Loading branch information
rchincha authored Nov 16, 2023
1 parent c81f395 commit edfada8
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/sync-3rdparty-images.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit edfada8

Please sign in to comment.