Skip to content

Sync GHCR images with stable Docker Hub images #77

Sync GHCR images with stable Docker Hub images

Sync GHCR images with stable Docker Hub images #77

name: Sync GHCR images with stable Docker Hub images
on:
schedule:
# run on Monday at 7
- cron: '0 7 * * 1'
workflow_dispatch:
inputs:
ghcr_org:
type: string
required: false
default: flatcar
description: |
The name of the GitHub org where the docker images should be pushed.
jobs:
mirror-stable-docker-images:
permissions:
packages: write
strategy:
matrix:
package: [nginx,busybox]
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Check out scripts
uses: actions/checkout@v4
- name: Login to GitHub Container Registry (ghcr)
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Mirror ${{ matrix.package }} stable image as latest to GHCR
env:
GHCR_ORG: ${{ inputs.ghcr_org }}
PACKAGE: ${{ matrix.package }}
run: .github/workflows/mirror-to-ghcr.sh -t latest -o "${GHCR_ORG:-flatcar}" "${PACKAGE}" stable