From 3214e94cdb4546c12b3a1d09f3e1f40a319f48aa Mon Sep 17 00:00:00 2001 From: Jade Ellis Date: Sat, 8 Nov 2025 21:07:41 +0000 Subject: [PATCH] ci: Mirror to ghcr --- .forgejo/regsync/regsync.yml | 4 ++++ .forgejo/workflows/mirror-images.yml | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.forgejo/regsync/regsync.yml b/.forgejo/regsync/regsync.yml index 0752791c..8af01cf5 100644 --- a/.forgejo/regsync/regsync.yml +++ b/.forgejo/regsync/regsync.yml @@ -43,6 +43,9 @@ creds: - registry: git.nexy7574.co.uk user: "{{env \"N7574_GIT_USERNAME\"}}" pass: "{{env \"N7574_GIT_TOKEN\"}}" + - registry: ghcr.io + user: "{{env \"GITHUB_USERNAME\"}}" + pass: "{{env \"GITHUB_TOKEN\"}}" # Global defaults defaults: @@ -58,5 +61,6 @@ sync: <<: *tags-main - source: *source target: git.nexy7574.co.uk/mirrored/continuwuity + target: ghcr.io/continuwuity/continuwuity type: repository <<: *tags-main diff --git a/.forgejo/workflows/mirror-images.yml b/.forgejo/workflows/mirror-images.yml index 3b7bdb74..999458c1 100644 --- a/.forgejo/workflows/mirror-images.yml +++ b/.forgejo/workflows/mirror-images.yml @@ -32,6 +32,15 @@ jobs: with: persist-credentials: false + - uses: https://github.com/actions/create-github-app-token@v2 + id: app-token + with: + app-id: ${{ vars.GH_APP_ID }} + private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} + github-api-url: https://api.github.com + owner: continuwuity + repositories: continuwuity + - name: Install regctl uses: https://forgejo.ellis.link/continuwuation/regclient-actions/regctl-installer@main with: @@ -44,6 +53,10 @@ jobs: - name: Mirror images if: ${{ !inputs.dry_run }} + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + GH_USERNAME: ${{ vars.GH_APP_ID }} + run: | echo "Starting image mirroring..." regsync once -c .forgejo/regsync/regsync.yml -v info