ci: skip deploy steps for test tags
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:
@@ -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 }}" \
|
||||
|
||||
Reference in New Issue
Block a user