sync-docker-repository #22
This file contains hidden or 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: sync-docker-repository | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| actions: read | |
| defaults: | |
| run: | |
| shell: bash | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| src-repository: | |
| description: 'Source Docker repository, inform of "namespace/name".' | |
| required: true | |
| default: 'gpustack/gpustack' | |
| type: string | |
| dst-registry: | |
| description: 'Destination Docker registry.' | |
| required: true | |
| default: 'quay.io' | |
| type: string | |
| dst-namespace: | |
| description: 'Destination Docker namespace, inform of "namespace".' | |
| required: true | |
| default: 'gpustack' | |
| type: string | |
| tag-include-regex: | |
| description: 'Regex to include tags from being synced.' | |
| required: false | |
| default: 'latest|v2' | |
| type: string | |
| tag-exclude-regex: | |
| description: 'Regex to exclude tags from being synced.' | |
| required: false | |
| default: 'main|-dev|[^.]rc' | |
| type: string | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Deps | |
| run: | | |
| #!/usr/bin/env bash | |
| wget -q https://github.com/foyoux/skopeo/releases/latest/download/skopeo-ubuntu-22.04.tar.gz -O skopeo-ubuntu-22.04.tar.gz | |
| tar -xzvf skopeo-ubuntu-22.04.tar.gz | |
| - name: Sync | |
| run: | | |
| #!/usr/bin/env bash | |
| ./skopeo-ubuntu-22.04 login -u ${{ secrets.CI_DOCKER_MIRROR_USERNAME }} -p ${{ secrets.CI_DOCKER_MIRROR_PASSWORD }} ${{ inputs.dst-registry }} | |
| ./skopeo-ubuntu-22.04 sync --all --retry-delay 5s --retry-times 10 --include-regex "${{ inputs.tag-include-regex }}" --exclude-regex "${{ inputs.tag-exclude-regex }}" --src docker --dest docker docker.io/${{ inputs.src-repository }} ${{ inputs.dst-registry }}/${{ inputs.dst-namespace }} |