From 260c493fc8ca6ce93c2e81ce89579b812e3e6da4 Mon Sep 17 00:00:00 2001 From: Huarch Date: Fri, 24 Apr 2026 16:05:08 +0800 Subject: [PATCH] ci: enable full cd path 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> --- .gitea/workflows/package.yml | 25 ------------------------- memery.md | 1 + 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/.gitea/workflows/package.yml b/.gitea/workflows/package.yml index f95d688..b28e96f 100644 --- a/.gitea/workflows/package.yml +++ b/.gitea/workflows/package.yml @@ -61,28 +61,16 @@ jobs: REPOSITORY_PATH="${RAW_REPOSITORY#/}" REPOSITORY_PATH="$(printf '%s' "$REPOSITORY_PATH" | tr '[:upper:]' '[:lower:]')" IMAGE_NAME="${REGISTRY_HOST}/${REPOSITORY_PATH}" - case "$IMAGE_TAG" in - *-test) IS_TEST_TAG=true ;; - *) IS_TEST_TAG=false ;; - esac { echo "REGISTRY_HOST=${REGISTRY_HOST}" echo "REPOSITORY_PATH=${REPOSITORY_PATH}" echo "IMAGE_NAME=${IMAGE_NAME}" echo "IMAGE_TAG=${IMAGE_TAG}" echo "IMAGE_REF=${IMAGE_NAME}:${IMAGE_TAG}" - echo "IS_TEST_TAG=${IS_TEST_TAG}" } >> "$GITHUB_ENV" - name: Login to Gitea Container Registry run: | - case "${{ github.ref_name }}" in - *-test) - echo "Test tag detected; skipping registry login." - exit 0 - ;; - esac - echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login "$REGISTRY_HOST" \ --username "${{ secrets.REGISTRY_USERNAME }}" \ --password-stdin @@ -103,24 +91,11 @@ jobs: --build-arg NEXT_PUBLIC_MAPBOX_TOKEN="${{ secrets.NEXT_PUBLIC_MAPBOX_TOKEN }}" \ --build-arg NEXT_PUBLIC_TIANDITU_TOKEN="${{ secrets.NEXT_PUBLIC_TIANDITU_TOKEN }}" \ . - case "${{ github.ref_name }}" in - *-test) - echo "Test tag detected; build completed without pushing images." - exit 0 - ;; - esac docker push "${IMAGE_NAME}:${IMAGE_TAG}" docker push "${IMAGE_NAME}:latest" - name: Notify Deploy Server run: | - case "${{ github.ref_name }}" in - *-test) - echo "Test tag detected; skipping deploy webhook." - exit 0 - ;; - esac - 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 de0ead5..5a47dd0 100644 --- a/memery.md +++ b/memery.md @@ -15,5 +15,6 @@ - **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. - **Follow-up from server validation:** the runner still executed `Notify Deploy Server` for `v2026.04.24-test5`, so Gitea step-level `if:` with `endsWith(...)` 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 `*-test` bypass logic was removed again so the workflow always runs registry login, image push, and deploy webhook. Full deployment validation now depends on using a normal `v*` 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 ...`, 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.