Skip to content

dockerhub-mirror

dockerhub-mirror #14

Workflow file for this run

name: dockerhub-mirror
on:
workflow_dispatch:
inputs:
dockerhub-repo:
description: 'DockerHub repository'
required: true
jobs:
dockerhub-mirror:
runs-on: ubuntu-latest
steps:
- name: Install regctl
uses: iarekylew00t/regctl-installer@v1
- name: Login to Docker Hub
run: |
echo "${{ secrets.DOCKERHUB_TOKEN }}" | \
regctl registry login docker.io \
--user "${{ vars.DOCKERHUB_USERNAME }}" \
--pass-stdin
- name: Login to GitHub Container Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | \
regctl registry login ghcr.io \
--user "${{ github.repository_owner }}" \
--pass-stdin
- name: Mirror ${{ github.event.inputs.dockerhub-repo }} to ${{ github.repository_owner }}/${{ github.event.inputs.dockerhub-repo }}
run: regctl image copy ${{ github.event.inputs.dockerhub-repo }} ghcr.io/${{ github.repository_owner }}/${{ github.event.inputs.dockerhub-repo }}