Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Jul 30, 2024
0 parents commit e06bad2
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/copy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: copy

on:
push:
branches:
- main

jobs:
copy:
runs-on: ubuntu-latest

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]
- name: copy
run: ./copy.sh ${{ github.repository_owner }}
20 changes: 20 additions & 0 deletions copy.sh
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

0 comments on commit e06bad2

Please sign in to comment.