260c493fc8
Remove test-tag bypass logic so release tags exercise registry login, image push, and deploy webhook end to end on Gitea Actions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4.1 KiB
4.1 KiB
CI build notes
2026-04-24
- Observed failure while reproducing workflow checkout locally: the
Checkout codestep rangit remote add origin ...unconditionally. In a workspace that already had anoriginremote, the job failed witherror: remote origin already exists.and exited beforedocker build. - Why this matters for act_runner: self-hosted Gitea runners can reuse working directories or start from repositories that already contain Git metadata, so checkout logic must be idempotent.
- Applied fix: changed
.gitea/workflows/package.ymlto initialize Git only when needed, usegit remote set-url origin ...whenoriginalready exists, and force-clean the workspace after checking outFETCH_HEAD. - Safety improvement for remote validation: tags ending with
-testnow run the build verification path only. They skip registry login, image push,latestupdates, and the deploy webhook so act_runner can be tested without deployment side effects. - Root cause found on the real act_runner: although the runner was registered with
ubuntu:docker://gitea/runner-images:ubuntu-22.04, the workflow usedruns-on: ubuntu, and the job log showedStart image=ubuntu:latest. That default image does not include the expected toolset, which explains the remotegit: not foundfailure. - Applied fix for label selection: changed both jobs to
runs-on: "ubuntu:docker://gitea/runner-images:ubuntu-22.04"so Gitea resolves the exact runner image instead of falling back toubuntu:latest. - Follow-up from server validation: Gitea then reported
No matching online runner with label: ubuntu:docker://gitea/runner-images:ubuntu-22.04. The runner advertises the short labelubuntu-22.04, so the workflow was updated again to useruns-on: ubuntu-22.04, which should map todocker://gitea/runner-images:ubuntu-22.04on the runner side. - Next remote failure on act_runner: Docker rejected the tag
gitea.waternetwork.cn/OrgTJWater/TJWaterFrontend_Refine:v2026.04.24-test3withrepository name must be lowercase. The workflow had normalized the registry host but not the repository path fromgithub.repository. - Applied fix for image naming: lowercased
REPOSITORY_PATHduring image metadata normalization so image tags remain valid even when the Gitea owner or repository name contains uppercase letters. - Latest remote failure on act_runner: a
*-testrun still reachedNotify Deploy Serverand failed withcurl: (3) URL using bad/illegal format or missing URL. That showed the shell-levelIS_TEST_TAGguard was not reliable enough for cross-step skip control on this runner. - Applied fix for test-tag skipping: moved registry login and deploy webhook skipping to workflow-level
if:conditions based onendsWith(github.ref_name, '-test'), and made the image-push branch check the tag name directly instead of relying onIS_TEST_TAGfrom a previous step. - Follow-up from server validation: the runner still executed
Notify Deploy Serverforv2026.04.24-test5, so Gitea step-levelif:withendsWith(...)was not sufficient in this environment. - Applied hardening: replaced those step-level conditions with direct shell
case "${{ github.ref_name }}" in *-test)guards inside the login, push, and deploy steps. This avoids relying on Gitea expression behavior for test-tag skipping. - Workflow mode changed for full CD verification: per latest request, all
*-testbypass logic was removed again so the workflow always runs registry login, image push, and deploy webhook. Full deployment validation now depends on using a normalv*tag and observing the real CD result instead of synthetic skip branches. - Current local result:
npm run lint,npm run test -- --runInBand,npm run build,docker build ..., andnpm run buildinsidegitea/runner-images:ubuntu-22.04all completed successfully after the workflow adjustment. - Non-blocking note: local Jest run reported a haste-map naming collision between
package.jsonand.next/standalone/package.json; tests still passed, and this does not affect the current image-build workflow.