Sync GHCR images with stable Docker Hub images #75
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |