From 35e4d3da86a9619f9844f694dad0173db09b4485 Mon Sep 17 00:00:00 2001 From: Sean O'Connor Date: Sun, 2 Aug 2026 16:54:15 -0400 Subject: [PATCH] fix: make docker build/push work with Gitea - Replace type=gha cache (broken on Gitea: unparseable runtime token) with type=registry cache using image-manifest/oci-mediatypes options that the Gitea registry accepts. - Push with a Gitea PAT (REGISTRY_TOKEN) since the auto job token cannot publish OCI images to the package repo. - Add registry login to the CI docker smoke-test job. --- .gitea/workflows/ci.yml | 7 +++++++ .gitea/workflows/publish.yml | 9 ++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 9403b0f..cb34265 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -14,6 +14,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.13" + cache: pip - run: pip install ruff - run: ruff check src/ - run: ruff format --check src/ @@ -36,8 +37,14 @@ jobs: steps: - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: git.soconnor.dev + username: ${{ gitea.repository_owner }} + password: ${{ secrets.REGISTRY_TOKEN }} - uses: docker/build-push-action@v6 with: context: . push: false tags: poke-mail:test + cache-from: type=registry,ref=git.soconnor.dev/soconnor/poke-mail:buildcache diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index 982b6fa..b9c5c38 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -12,9 +12,6 @@ env: jobs: build-and-push: runs-on: ubuntu-latest - permissions: - contents: read - packages: write steps: - uses: actions/checkout@v4 @@ -24,8 +21,8 @@ jobs: - uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} - username: ${{ gitea.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ gitea.repository_owner }} + password: ${{ secrets.REGISTRY_TOKEN }} - uses: docker/metadata-action@v5 id: meta @@ -43,3 +40,5 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ No newline at end of file