fix: derive registry host from gitea.server_url instead of unset variable
Some checks failed
Build and Deploy / build-and-push (push) Failing after 1m7s
Some checks failed
Build and Deploy / build-and-push (push) Failing after 1m7s
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 <noreply@anthropic.com>
This commit is contained in:
@@ -12,19 +12,23 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set image name
|
- name: Set image tags
|
||||||
id: image
|
id: image
|
||||||
run: |
|
run: |
|
||||||
IMAGE="${{ vars.REGISTRY_URL }}/josh/sixflagssupercalendar"
|
# Gitea's container registry lives on the same host as the Gitea instance
|
||||||
SHA="${{ github.sha }}"
|
REGISTRY="${{ gitea.server_url }}"
|
||||||
echo "full=${IMAGE}" >> "$GITHUB_OUTPUT"
|
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_latest=${IMAGE}:latest" >> "$GITHUB_OUTPUT"
|
||||||
echo "tag_sha=${IMAGE}:${SHA::8}" >> "$GITHUB_OUTPUT"
|
echo "tag_sha=${IMAGE}:${SHA::8}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Log in to registry
|
- name: Log in to registry
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.REGISTRY_TOKEN }}" | \
|
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
|
- name: Build image
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -122,10 +122,11 @@ The pipeline is defined at [`.gitea/workflows/deploy.yml`](.gitea/workflows/depl
|
|||||||
|
|
||||||
| Type | Name | Value |
|
| 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 |
|
| 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
|
#### Upstream remote
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
image: ${REGISTRY_URL}/josh/sixflagssupercalendar:latest
|
image: ${REGISTRY_URL:-gitea.thewrightserver.net}/josh/sixflagssupercalendar:latest
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
|||||||
Reference in New Issue
Block a user