36 lines
1,014 B
YAML
36 lines
1,014 B
YAML
|
# 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
|