From cafc126d1b11ac283aff24c152fbe479454a030b Mon Sep 17 00:00:00 2001 From: Andrii Arsenin Date: Thu, 1 Oct 2026 11:11:39 +0300 Subject: [PATCH] ci: set the image registry explicitly - use REGISTRY (git.hq.ars9.space) for login and image tags instead of deriving it from the server url, which is the runner's registration address and may be internal-only - document how jobs reach gitea when the runner uses an internal address --- .gitea/workflows/ci.yml | 13 ++++++++----- docs/development.md | 4 +++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 671834d..aba8873 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -4,7 +4,9 @@ # version and `latest`. # # Needs a repository (or owner) secret REGISTRY_TOKEN: a Gitea access token -# with package write access for the repository owner. +# with package write access for the repository owner. The registry host is +# set explicitly below rather than taken from the server URL, which is the +# address the runner was registered with and may be internal-only. name: CI @@ -13,6 +15,9 @@ on: branches: [master] pull_request: +env: + REGISTRY: git.hq.ars9.space + jobs: server: runs-on: ubuntu-latest @@ -91,10 +96,8 @@ jobs: REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} OWNER: ${{ github.repository_owner }} run: | - registry="${GITHUB_SERVER_URL#*://}" - echo "REGISTRY=${registry}" >> "$GITHUB_ENV" - echo "IMAGE=${registry}/$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" - echo "$REGISTRY_TOKEN" | docker login "$registry" -u "$OWNER" --password-stdin + echo "IMAGE=${REGISTRY}/$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" + echo "$REGISTRY_TOKEN" | docker login "$REGISTRY" -u "$OWNER" --password-stdin - name: Build run: docker build -t "${IMAGE}:${VERSION}" -t "${IMAGE}:latest" . - name: Push diff --git a/docs/development.md b/docs/development.md index a2f30e7..47d9f20 100644 --- a/docs/development.md +++ b/docs/development.md @@ -224,10 +224,12 @@ docker compose build --no-cache - **server**: lint (no warnings allowed), type-check, tests, build. - **client**: lint (no warnings allowed), build, Storybook tests in headless Chromium. -- **image** (pushes to `master` only): when the push changes `version` in the root `package.json`, and both check jobs pass, builds the Docker image and pushes it to the Gitea instance's container registry as `//:` and `:latest`. +- **image** (pushes to `master` only): when the push changes `version` in the root `package.json`, and both check jobs pass, builds the Docker image and pushes it to the Gitea container registry set by `REGISTRY` at the top of the workflow (`git.hq.ars9.space`) as `//:` and `:latest`. The image job logs in as the repository owner with the `REGISTRY_TOKEN` secret: a Gitea access token with package write access (Settings → Applications → token with `write:package`), added under the repository's Settings → Actions → Secrets. It runs `docker` on the runner, so the runner must give jobs access to a Docker daemon (act_runner mounts the host's Docker socket into job containers by default). +Jobs clone the repository from the address the runner was registered with. If that's an internal hostname (such as `http://gitea:3000` from Gitea's compose network), job containers can't resolve it: either register the runner with the public URL, or set `container.network` in the act_runner config to Gitea's Docker network so jobs join it. + --- ## Running with Docker Compose