Use runner-local Gitea registry endpoint

This commit is contained in:
Georgi Manchev
2026-09-29 01:36:22 +03:00
parent 337052d8a5
commit 9e004756d8
3 changed files with 20 additions and 10 deletions
+17 -8
View File
@@ -6,7 +6,7 @@ on:
- "v*.*.*"
env:
REGISTRY: git.mancheff.com
REGISTRY: 192.168.0.86:3000
IMAGE_NAME: hiyv-demo/hiyv-nginx
jobs:
@@ -38,15 +38,23 @@ jobs:
echo "tags=${image}:${version},${image}:${major_minor},${image}:${major},${image}:${GITHUB_SHA},${image}:latest"
} >> "${GITHUB_OUTPUT}"
- name: Log in to the Gitea registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Configure Gitea registry credentials
shell: bash
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
mkdir -p "${HOME}/.docker"
auth="$(printf '%s:%s' "${REGISTRY_USERNAME}" "${REGISTRY_TOKEN}" | base64 | tr -d '\n')"
printf '{"auths":{"%s":{"auth":"%s"}}}\n' "${REGISTRY}" "${auth}" > "${HOME}/.docker/config.json"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-config-inline: |
[registry."192.168.0.86:3000"]
http = true
insecure = true
- name: Build and publish
uses: docker/build-push-action@v6
@@ -55,9 +63,10 @@ jobs:
push: true
build-args: |
COMMIT_ID=${{ github.sha }}
NGINX_BASE=${{ env.REGISTRY }}/hiyv-demo/nginx-base:1.28-alpine-amd64
tags: ${{ steps.tags.outputs.tags }}
labels: |
org.opencontainers.image.version=${{ steps.tags.outputs.version }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.source=https://git.mancheff.com/${{ github.repository }}
platforms: linux/amd64
+2 -1
View File
@@ -1,4 +1,5 @@
FROM git.mancheff.com/hiyv-demo/nginx-base:1.28-alpine-amd64
ARG NGINX_BASE=git.mancheff.com/hiyv-demo/nginx-base:1.28-alpine-amd64
FROM ${NGINX_BASE}
ARG COMMIT_ID=unknown
+1 -1
View File
@@ -6,7 +6,7 @@ Git commit used to build the published container.
## Run it
```sh
docker run --rm -p 8080:80 git.mancheff.com/hiyv-demo/hiyv-nginx:1.0.2
docker run --rm -p 8080:80 git.mancheff.com/hiyv-demo/hiyv-nginx:1.0.3
```
Open <http://localhost:8080>. The health endpoint is available at