From a36720cd0a70d89ad7a249c12976990e949f268f Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Wed, 17 Apr 2024 14:28:21 +0200 Subject: [PATCH] Add registry migration workflow Issue: S3UTILS-159 --- .github/workflows/migrate.yaml | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/migrate.yaml diff --git a/.github/workflows/migrate.yaml b/.github/workflows/migrate.yaml new file mode 100644 index 00000000..c220fa21 --- /dev/null +++ b/.github/workflows/migrate.yaml @@ -0,0 +1,42 @@ +--- +name: migrate + +on: + push: + branches-ignore: + - development/** + - q/*/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Sync ${{ github.event.repository.name }} + run: | + docker run --rm quay.io/skopeo/stable:v1.15.0 sync \ + --src docker --dest docker --all --preserve-digests --retry-times 3 \ + --src-creds ${{ secrets.REGISTRY_LOGIN }}:${{ secrets.REGISTRY_PASSWORD }} \ + --dest-creds ${{ github.repository_owner }}:${{ github.token }} \ + registry.scality.com/${{ github.event.repository.name }}/${{ github.event.repository.name }} \ + ghcr.io/${{ github.repository_owner }}/ + - name: Sync ${{ github.event.repository.name }}-dashboards + run: | + docker run --rm quay.io/skopeo/stable:v1.15.0 sync \ + --src docker --dest docker --all --preserve-digests --retry-times 3 \ + --src-creds ${{ secrets.REGISTRY_LOGIN }}:${{ secrets.REGISTRY_PASSWORD }} \ + --dest-creds ${{ github.repository_owner }}:${{ github.token }} \ + registry.scality.com/${{ github.event.repository.name }}/${{ github.event.repository.name }}-dashboards \ + ghcr.io/${{ github.repository }} + - name: Sync zenko/s3utils + run: | + docker run --rm quay.io/skopeo/stable:v1.15.0 sync \ + --src docker --dest docker --all --preserve-digests --retry-times 3 \ + --dest-creds ${{ github.repository_owner }}:${{ github.token }} \ + zenko/${{ github.event.repository.name }} \ + ghcr.io/${{ github.repository_owner }}/ + + docker run --rm quay.io/skopeo/stable:v1.15.0 copy --preserve-digests --retry-times 3 \ + --dest-creds ${{ github.repository_owner }}:${{ github.token }} \ + docker:zenko/${{ github.event.repository.name }}:1.0.0 \ + docker:ghcr.io/${{ github.repository }}:1.0.0