From 815bd63c68b5ed9d16ce0951686ff97dfcc07746 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Wed, 22 May 2024 17:58:32 -0400 Subject: [PATCH] Move to sh file --- .github/workflows/sync-registry.yaml | 17 +++++++++++------ .../hack/{sync-registry.yaml => regsync.yaml} | 4 ---- build-scripts/hack/sync-registry.sh | 1 + 3 files changed, 12 insertions(+), 10 deletions(-) rename build-scripts/hack/{sync-registry.yaml => regsync.yaml} (52%) create mode 100755 build-scripts/hack/sync-registry.sh diff --git a/.github/workflows/sync-registry.yaml b/.github/workflows/sync-registry.yaml index 503ac07a5..ce983e729 100644 --- a/.github/workflows/sync-registry.yaml +++ b/.github/workflows/sync-registry.yaml @@ -5,6 +5,13 @@ jobs: publish: runs-on: ubuntu-22.04 steps: + - name: Login to target registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout repository uses: actions/checkout@v4 @@ -13,11 +20,9 @@ jobs: with: go-version: '>=1.22' - - run: go install github.com/regclient/regclient/cmd/regsync@latest - - name: Sync registry.k8s.io to ghcr.io/canonical - env: - USERNAME: ${{ github.actor }} - TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - regsync once --config ${GITHUB_WORKSPACE}/build-scripts/hack/sync-registry.yaml + curl -L https://github.com/regclient/regclient/releases/download/v0.6.1/regsync-linux-amd64 -o regsync + chmod +x regsync + ./regsync version + ./regsync once -c build-scripts/hack/regsync.yaml diff --git a/build-scripts/hack/sync-registry.yaml b/build-scripts/hack/regsync.yaml similarity index 52% rename from build-scripts/hack/sync-registry.yaml rename to build-scripts/hack/regsync.yaml index 8b04c88f3..508a976cd 100644 --- a/build-scripts/hack/sync-registry.yaml +++ b/build-scripts/hack/regsync.yaml @@ -1,8 +1,4 @@ version: 1 -creds: - - registry: ghcr.io/canonical - user: "{{env \"USERNAME\"}}" - pass: "{{env \"TOKEN\"}}" sync: - source: registry.k8s.io/pause:3.7 target: ghcr.io/canonical/pause:3.7 diff --git a/build-scripts/hack/sync-registry.sh b/build-scripts/hack/sync-registry.sh new file mode 100755 index 000000000..152ad5f1f --- /dev/null +++ b/build-scripts/hack/sync-registry.sh @@ -0,0 +1 @@ +regsync once ./sync-registry.yaml