diff --git a/.gitea/workflows/package.yml b/.gitea/workflows/package.yml index 790f6ec..eef9682 100644 --- a/.gitea/workflows/package.yml +++ b/.gitea/workflows/package.yml @@ -75,12 +75,8 @@ jobs: } >> "$GITHUB_ENV" - name: Login to Gitea Container Registry + if: ${{ !endsWith(github.ref_name, '-test') }} run: | - if [ "$IS_TEST_TAG" = "true" ]; then - echo "Test tag detected; skipping registry login." - exit 0 - fi - echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login "$REGISTRY_HOST" \ --username "${{ secrets.REGISTRY_USERNAME }}" \ --password-stdin @@ -101,7 +97,7 @@ jobs: --build-arg NEXT_PUBLIC_MAPBOX_TOKEN="${{ secrets.NEXT_PUBLIC_MAPBOX_TOKEN }}" \ --build-arg NEXT_PUBLIC_TIANDITU_TOKEN="${{ secrets.NEXT_PUBLIC_TIANDITU_TOKEN }}" \ . - if [ "$IS_TEST_TAG" = "true" ]; then + if [ "${{ endsWith(github.ref_name, '-test') }}" = "true" ]; then echo "Test tag detected; build completed without pushing images." exit 0 fi @@ -109,13 +105,8 @@ jobs: docker push "${IMAGE_NAME}:latest" - name: Notify Deploy Server - if: success() + if: ${{ success() && !endsWith(github.ref_name, '-test') }} run: | - if [ "$IS_TEST_TAG" = "true" ]; then - echo "Test tag detected; skipping deploy webhook." - exit 0 - fi - curl -fsSL -X POST "${{ vars.DEPLOY_WEBHOOK_URL }}" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${{ secrets.DEPLOY_WEBHOOK_TOKEN }}" \ diff --git a/memery.md b/memery.md index edf3e3c..e93b1b8 100644 --- a/memery.md +++ b/memery.md @@ -11,5 +11,7 @@ - **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 label `ubuntu-22.04`, so the workflow was updated again to use `runs-on: ubuntu-22.04`, which should map to `docker://gitea/runner-images:ubuntu-22.04` on the runner side. - **Next remote failure on act_runner:** Docker rejected the tag `gitea.waternetwork.cn/OrgTJWater/TJWaterFrontend_Refine:v2026.04.24-test3` with `repository name must be lowercase`. The workflow had normalized the registry host but not the repository path from `github.repository`. - **Applied fix for image naming:** lowercased `REPOSITORY_PATH` during 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 `*-test` run still reached `Notify Deploy Server` and failed with `curl: (3) URL using bad/illegal format or missing URL`. That showed the shell-level `IS_TEST_TAG` guard 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 on `endsWith(github.ref_name, '-test')`, and made the image-push branch check the tag name directly instead of relying on `IS_TEST_TAG` from a previous step. - **Current local result:** `npm run lint`, `npm run test -- --runInBand`, `npm run build`, `docker build ...`, and `npm run build` inside `gitea/runner-images:ubuntu-22.04` all completed successfully after the workflow adjustment. - **Non-blocking note:** local Jest run reported a haste-map naming collision between `package.json` and `.next/standalone/package.json`; tests still passed, and this does not affect the current image-build workflow.