Initial commit.
This commit is contained in:
commit
bc58782d80
3 changed files with 61 additions and 0 deletions
35
.forgejo/workflows/mirrors.yaml
Normal file
35
.forgejo/workflows/mirrors.yaml
Normal file
|
@ -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.envsubst.yml >.regsync.yml
|
||||
echo "Running regsync"
|
||||
regsync --config .regsync.yml once
|
||||
echo "Cleaning up"
|
||||
rm -f .regsync.yml
|
9
README.md
Normal file
9
README.md
Normal file
|
@ -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)).
|
17
regsync.envsubst.yml
Normal file
17
regsync.envsubst.yml
Normal file
|
@ -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+"
|
Loading…
Add table
Reference in a new issue