Mirror docker images to ghcr.io #17
This file contains hidden or 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: Mirror docker images to ghcr.io | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 2' | |
jobs: | |
mirror: | |
name: Mirror images | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- image: ubuntu | |
tag: latest | |
- image: ubuntu | |
tag: plucky | |
- image: ubuntu | |
tag: noble | |
- image: ubuntu | |
tag: jammy | |
- image: ubuntu | |
tag: focal | |
- image: debian | |
tag: latest | |
- image: fedora # For tool/annocheck of ruby/ruby | |
tag: latest | |
steps: | |
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.GHCR_USER }} | |
password: ${{ secrets.GHCR_ACCESS_TOKEN }} | |
- uses: actions/setup-go@v5 | |
- run: go install github.com/google/go-containerregistry/cmd/crane@latest | |
- name: Mirror | |
run: crane copy docker.io/${{ matrix.image }}:${{ matrix.tag }} ghcr.io/ruby/${{ matrix.image }}:${{ matrix.tag }} |