Skip to content

Sync images and artifacts to ghcr #375

Sync images and artifacts to ghcr

Sync images and artifacts to ghcr #375

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 alpine:3.19 centos:latest busybox:latest; do
dest="ghcr.io/${{ github.repository_owner }}/$n"
docker trust inspect "$n"
docker pull $n
docker tag $n "$dest"
docker push $dest
done