Skip to content

Sync images

Sync images #631

Workflow file for this run

name: "Sync images"
on:
push:
branches:
- "main"
paths:
- '.github/workflows/dry.yml'
- '.github/workflows/sync.yml'
- 'modules/**'
- '!README.md'
- '!single_sync.sh'
- '!single_sync_v2.sh'
- 'single_sync_v3.sh'
schedule:
- cron: "0 2 * * *"
jobs:
fetch_modules_to_sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set output
id: set_output
run: |
MODULES_TO_SYNC_JSON=$(find modules -type d -mindepth 1 -maxdepth 1 | cut -d/ -f2 | sort | jq -R | jq -cs . )
echo "MODULES_TO_SYNC_JSON=${MODULES_TO_SYNC_JSON}" >> $GITHUB_OUTPUT
outputs:
modules_to_sync: ${{ steps.set_output.outputs.MODULES_TO_SYNC_JSON }}
sync:
runs-on: ubuntu-latest
needs: fetch_modules_to_sync
strategy:
fail-fast: false
matrix:
module: ${{ fromJson(needs.fetch_modules_to_sync.outputs.modules_to_sync) }}
steps:
- uses: actions/checkout@master
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME_TEMP }}
password: ${{ secrets.DOCKERHUB_PASSWORD_TEMP }}
- name: Login to SIGHUP new Registry
uses: docker/login-action@v3
with:
registry: registry.sighup.io
username: ${{ secrets.SIGHUP_REGISTRY_USERNAME }}
password: ${{ secrets.SIGHUP_REGISTRY_PASSWORD }}
- name: Install yq
run: |
sudo apt-get update && sudo apt-get install -yqq wget
sudo wget -q https://github.com/mikefarah/yq/releases/download/v4.19.1/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
- # Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Sync ${{ matrix.module }}
run: |
yq --version
docker run --rm quay.io/skopeo/stable:v1.13 --version
docker run -v ./login:/login --rm quay.io/skopeo/stable:v1.13 login --username ${{ secrets.DOCKERHUB_USERNAME_TEMP }} --password ${{ secrets.DOCKERHUB_PASSWORD_TEMP }} docker.io --authfile=/login/auth.json
docker run -v ./login:/login --rm quay.io/skopeo/stable:v1.13 login --username ${{ secrets.SIGHUP_REGISTRY_USERNAME }} --password ${{ secrets.SIGHUP_REGISTRY_PASSWORD }} registry.sighup.io --authfile=/login/auth.json
./single_sync_v3.sh modules/${{ matrix.module }}/images.yml false