dockerhub-mirror #20
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: 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 }} |