Skip to content

Commit

Permalink
Move to sh file
Browse files Browse the repository at this point in the history
  • Loading branch information
eaudetcobello committed May 22, 2024
1 parent df5fcc6 commit 9e4035f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/sync-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: test

- name: Checkout repository
uses: actions/checkout@v4

Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
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
type: image
tags:
allow:
- "*"
1 change: 1 addition & 0 deletions build-scripts/hack/sync-registry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
regsync once ./sync-registry.yaml

0 comments on commit 9e4035f

Please sign in to comment.