mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-11 21:53:02 +02:00
Compare commits
2 commits
0996d4820a
...
f567af24ab
Author | SHA1 | Date | |
---|---|---|---|
|
f567af24ab |
||
|
af8783ee51 |
3 changed files with 118 additions and 1 deletions
55
.forgejo/regsync/regsync.yml
Normal file
55
.forgejo/regsync/regsync.yml
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
version: 1
|
||||||
|
|
||||||
|
x-source: &source forgejo.ellis.link/continuwuation/continuwuity
|
||||||
|
|
||||||
|
x-tags:
|
||||||
|
releases: &tags-releases
|
||||||
|
tags:
|
||||||
|
allow:
|
||||||
|
- "latest"
|
||||||
|
- "v[0-9]+\\.[0-9]+\\.[0-9]+"
|
||||||
|
- "v[0-9]+\\.[0-9]+"
|
||||||
|
- "v[0-9]+"
|
||||||
|
main: &tags-main
|
||||||
|
tags:
|
||||||
|
allow:
|
||||||
|
- "latest"
|
||||||
|
- "v[0-9]+\\.[0-9]+\\.[0-9]+"
|
||||||
|
- "v[0-9]+\\.[0-9]+"
|
||||||
|
- "v[0-9]+"
|
||||||
|
- "main"
|
||||||
|
commits: &tags-commits
|
||||||
|
tags:
|
||||||
|
allow:
|
||||||
|
- "latest"
|
||||||
|
- "v[0-9]+\\.[0-9]+\\.[0-9]+"
|
||||||
|
- "v[0-9]+\\.[0-9]+"
|
||||||
|
- "v[0-9]+"
|
||||||
|
- "main"
|
||||||
|
- "sha-[a-f0-9]+"
|
||||||
|
all: &tags-all
|
||||||
|
tags:
|
||||||
|
allow:
|
||||||
|
- ".*"
|
||||||
|
|
||||||
|
# Registry credentials
|
||||||
|
creds:
|
||||||
|
- registry: forgejo.ellis.link
|
||||||
|
user: "{{env \"BUILTIN_REGISTRY_USER\"}}"
|
||||||
|
pass: "{{env \"BUILTIN_REGISTRY_PASSWORD\"}}"
|
||||||
|
- registry: registry.gitlab.com
|
||||||
|
user: "{{env \"GITLAB_USERNAME\"}}"
|
||||||
|
pass: "{{env \"GITLAB_TOKEN\"}}"
|
||||||
|
|
||||||
|
# Global defaults
|
||||||
|
defaults:
|
||||||
|
parallel: 3
|
||||||
|
interval: 2h
|
||||||
|
digestTags: true
|
||||||
|
|
||||||
|
# Sync configuration - each registry gets different image sets
|
||||||
|
sync:
|
||||||
|
- source: *source
|
||||||
|
target: registry.gitlab.com/continuwuity/continuwuity
|
||||||
|
type: repository
|
||||||
|
<<: *tags-main
|
47
.forgejo/workflows/mirror-images.yml
Normal file
47
.forgejo/workflows/mirror-images.yml
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
name: Mirror Container Images
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# Run every 2 hours
|
||||||
|
- cron: "0 */2 * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
dry_run:
|
||||||
|
description: 'Dry run (check only, no actual mirroring)'
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "mirror-images"
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
mirror-images:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
BUILTIN_REGISTRY_USER: ${{ secrets.BUILTIN_REGISTRY_USER }}
|
||||||
|
BUILTIN_REGISTRY_PASSWORD: ${{ secrets.BUILTIN_REGISTRY_PASSWORD }}
|
||||||
|
GITLAB_USERNAME: ${{ secrets.GITLAB_USERNAME }}
|
||||||
|
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install regctl
|
||||||
|
uses: https://forgejo.ellis.link/continuwuation/regclient-actions/regctl-installer@main
|
||||||
|
with:
|
||||||
|
binary: regsync
|
||||||
|
|
||||||
|
- name: Check what images need mirroring
|
||||||
|
run: |
|
||||||
|
echo "Checking images that need mirroring..."
|
||||||
|
regsync check -c .forgejo/regsync/regsync.yml -v info
|
||||||
|
|
||||||
|
- name: Mirror images
|
||||||
|
if: ${{ !inputs.dry_run }}
|
||||||
|
run: |
|
||||||
|
echo "Starting image mirroring..."
|
||||||
|
regsync once -c .forgejo/regsync/regsync.yml -v info
|
|
@ -204,13 +204,28 @@ jobs:
|
||||||
digest="${{ steps.build.outputs.digest }}"
|
digest="${{ steps.build.outputs.digest }}"
|
||||||
touch "/tmp/digests/${digest#sha256:}"
|
touch "/tmp/digests/${digest#sha256:}"
|
||||||
|
|
||||||
|
- name: Extract binary from container
|
||||||
|
run: |
|
||||||
|
mkdir -p /tmp/binaries
|
||||||
|
digest="${{ steps.build.outputs.digest }}"
|
||||||
|
container_id=$(docker create --platform ${{ matrix.platform }} ${{ needs.define-variables.outputs.images_list }}@$digest)
|
||||||
|
docker cp $container_id:/sbin/conduwuit /tmp/binaries/conduwuit-${{ matrix.target_cpu }}-${{ matrix.slug }}-${{ matrix.profile }}
|
||||||
|
docker rm -v $container_id
|
||||||
|
|
||||||
|
- name: Upload binary artifact
|
||||||
|
uses: https://code.forgejo.org/actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: conduwuit-${{ matrix.target_cpu }}-${{ matrix.slug }}-${{ matrix.profile }}"
|
||||||
|
path: /tmp/binaries/conduwuit-${{ matrix.target_cpu }}-${{ matrix.slug }}-${{ matrix.profile }}"
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload digest
|
- name: Upload digest
|
||||||
uses: forgejo/upload-artifact@v4
|
uses: forgejo/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: digests-${{ matrix.slug }}
|
name: digests-${{ matrix.slug }}
|
||||||
path: /tmp/digests/*
|
path: /tmp/digests/*
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 5
|
||||||
|
|
||||||
merge:
|
merge:
|
||||||
runs-on: dind
|
runs-on: dind
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue