Skip to content

dockerhub-mirror

dockerhub-mirror #18

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: regctl registry login docker.io --user "${{ vars.DOCKERHUB_USERNAME }}" --pass "${{ secrets.DOCKERHUB_TOKEN }}"
- name: Login to GitHub Container Registry
run: regctl registry login ghcr.io --user "${{ github.repository_owner }}" --pass "${{ secrets.GITHUB_TOKEN }}"
- 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 }}