-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 73972d0
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: copy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
copy: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to Docker Hub registry | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_READ_ONLY }} | ||
- name: Login to github docker registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: imjasonh/[email protected] | ||
# this will fail the first time when copying an image :/ | ||
- name: copy | ||
uses: nick-fields/retry@v3 | ||
with: | ||
timeout_minutes: 5 | ||
max_attempts: 2 | ||
command: ./copy.sh |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
target_registry=$1 | ||
|
||
source_images=( | ||
# localnet test images | ||
"ruimarinho/bitcoin-core:22" | ||
"ethereum/client-go:v1.10.26" | ||
|
||
# localnet build images | ||
"golang:1.22.5-bookworm" | ||
) | ||
|
||
for source_image in "${source_images[@]}"; do | ||
# replaces slashes in images names with dashes | ||
target_image_name=$(echo "${source_image}" | tr '/' '-') | ||
crane copy "${source_image}" "${target_registry}/${target_image_name}" | ||
done |