From a2b59b2f8d27afb6e6f801095bf36b644912d7a4 Mon Sep 17 00:00:00 2001 From: josh Date: Sat, 4 Apr 2026 01:05:50 -0400 Subject: [PATCH] fix: derive registry host from gitea.server_url instead of unset variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit REGISTRY_URL var was empty so docker login fell through to Docker Hub. Now strips protocol from gitea.server_url to get the registry hostname — no manual variable needed. docker-compose defaults to the known host. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/deploy.yml | 14 +++++++++----- README.md | 5 +++-- docker-compose.yml | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index c7a9fff..83a7e8e 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -12,19 +12,23 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Set image name + - name: Set image tags id: image run: | - IMAGE="${{ vars.REGISTRY_URL }}/josh/sixflagssupercalendar" - SHA="${{ github.sha }}" - echo "full=${IMAGE}" >> "$GITHUB_OUTPUT" + # Gitea's container registry lives on the same host as the Gitea instance + REGISTRY="${{ gitea.server_url }}" + REGISTRY="${REGISTRY#https://}" + REGISTRY="${REGISTRY#http://}" + IMAGE="${REGISTRY}/josh/sixflagssupercalendar" + SHA="${{ gitea.sha }}" + echo "registry=${REGISTRY}" >> "$GITHUB_OUTPUT" echo "tag_latest=${IMAGE}:latest" >> "$GITHUB_OUTPUT" echo "tag_sha=${IMAGE}:${SHA::8}" >> "$GITHUB_OUTPUT" - name: Log in to registry run: | echo "${{ secrets.REGISTRY_TOKEN }}" | \ - docker login "${{ vars.REGISTRY_URL }}" -u josh --password-stdin + docker login "${{ steps.image.outputs.registry }}" -u josh --password-stdin - name: Build image run: | diff --git a/README.md b/README.md index 83a114c..47e9f53 100644 --- a/README.md +++ b/README.md @@ -122,10 +122,11 @@ The pipeline is defined at [`.gitea/workflows/deploy.yml`](.gitea/workflows/depl | Type | Name | Value | |------|------|-------| -| Variable | `REGISTRY_URL` | Your registry host, e.g. `gitea.example.com` | | Secret | `REGISTRY_TOKEN` | A Gitea access token with `package:write` scope | -Set these under **Repository → Settings → Actions → Variables / Secrets**. +Set this under **Repository → Settings → Actions → Secrets**. + +The registry host is derived automatically from `gitea.server_url` — no `REGISTRY_URL` variable needed. #### Upstream remote diff --git a/docker-compose.yml b/docker-compose.yml index e3486e9..501acd1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: web: - image: ${REGISTRY_URL}/josh/sixflagssupercalendar:latest + image: ${REGISTRY_URL:-gitea.thewrightserver.net}/josh/sixflagssupercalendar:latest build: context: . dockerfile: Dockerfile