ci: skip deploy steps for test tags
Build Push and Deploy / docker-image (push) Failing after 50s
Build Push and Deploy / deploy-fallback-log (push) Successful in 1s

Use workflow-level conditions for registry login and deploy webhook steps so *-test tags only validate the build path on Gitea Actions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-04-24 15:57:38 +08:00
parent 9206c480b2
commit 5ca9a55a7b
2 changed files with 5 additions and 12 deletions
+3 -12
View File
@@ -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 }}" \