From bc58782d80dfd99236a9b7217364aa6515ddca1a Mon Sep 17 00:00:00 2001 From: Sergio Talens-Oliag Date: Fri, 14 Mar 2025 08:48:54 +0100 Subject: [PATCH] Initial commit. --- .forgejo/workflows/mirrors.yaml | 35 +++++++++++++++++++++++++++++++++ README.md | 9 +++++++++ regsync.envsubst.yml | 17 ++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 .forgejo/workflows/mirrors.yaml create mode 100644 README.md create mode 100644 regsync.envsubst.yml diff --git a/.forgejo/workflows/mirrors.yaml b/.forgejo/workflows/mirrors.yaml new file mode 100644 index 0000000..64af9ea --- /dev/null +++ b/.forgejo/workflows/mirrors.yaml @@ -0,0 +1,35 @@ +# Based on https://code.forgejo.org/forgejo/oci-mirror/raw/branch/main/.forgejo/workflows/mirror.yml +name: mirror + +on: + schedule: + - cron: '@daily' + push: + branches: + - main + paths: + - 'regsync.envsubst.yml' + workflow_dispatch: + +jobs: + mirror: + if: ${{ vars.REGISTRY_USER != '' && secrets.REGISTRY_PASS != '' }} + runs-on: docker + container: + image: forgejo.mixinet.net/oci/node-mixinet:latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + show-progress: false + - name: Sync images + run: | + echo "Creating .regsync.yml file" + REGISTRY="$(echo "${{ github.server_url }}" | sed -e 's%https://%%')" \ + REGISTRY_USER="${{ vars.REGISTRY_USER }}" \ + REGISTRY_PASS="${{ secrets.REGISTRY_PASS }}" \ + envsubst .regsync.yml + echo "Running regsync" + regsync --config .regsync.yml once + echo "Cleaning up" + rm -f .regsync.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..58f67da --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Mixinet OCI images mirror + +This repository contains a configuration file to synchronize images on the [OCI](https://forgejo.mixinet.dev/oci/) +organization of the [mixinet forgejo](https://forgejo.mixinet.net) instance using the +[regsync](https://regclient.org/cli/regsync/) tool. + +The tool is executed daily and on each push to the main branch of the repository using a forgejo action. The action +uses an image that is also on the organization that has the tool already installed (see the [images +project](https://forgejo.mixinet.dev/oci/images)). diff --git a/regsync.envsubst.yml b/regsync.envsubst.yml new file mode 100644 index 0000000..1aa89f7 --- /dev/null +++ b/regsync.envsubst.yml @@ -0,0 +1,17 @@ +version: 1 +creds: + - registry: "$REGISTRY" + user: "$REGISTRY_USER" + pass: "$REGISTRY_PASS" +sync: + - source: alpine + target: $REGISTRY/oci/alpine + type: repository + tags: + allow: + - "latest" + - "3\\.2\\d+" + - "3\\.2\\d+.\\d+" + deny: + - "3\\.20" + - "3\\.20.\\d+"