Skip to main content

GitHub Action: sync-docker-repos

GitHub Action to sync two docker repositories.

Introduction

GitHub Action to sync two docker repositories

Usage

Below is an example workflow that uses the github-action-sync-docker-repos action to sync a Docker Hub repository with an AWS ECR repository.

jobs:
example:
runs-on: ubuntu-latest
steps:
- name: github-action-sync-docker-repos
id: login-aws
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-east-1
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: github-action-sync-docker-repos
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: "true"

- name: github-action-sync-docker-repos
uses: cloudposse/github-action-sync-docker-repos@main
with:
src: busybox
dest: 111111111111.dkr.ecr.us-east-1.amazonaws.com
dest-credentials: "${{ steps.login-ecr.outputs.docker_username_111111111111_dkr_ecr_us_east_1_amazonaws_com }}:${{ steps.login-ecr.outputs.docker_password_111111111111_dkr_ecr_us_east_1_amazonaws_com }}"

Inputs

NameDescriptionDefaultRequired
destThe destination repository to sync to.N/Atrue
dest-credentialsThe destination repository credentials.N/Afalse
override-archOverride the architecture of the src image.N/Afalse
override-multi-archIf one of the images in src refers to a list of images, instead of copying just the image which matches the
current OS and architecture, attempt to copy all of the images in the list, and the list itself.
truefalse
override-osOverride the operating system of the src image.N/Afalse
srcThe source repository to sync from.N/Atrue
src-credentialsThe source repository credentials.N/Afalse