更新 Gitea CI/CD 触发逻辑,支持通过标签触发

This commit is contained in:
2026-05-19 11:31:38 +08:00
parent ebb0743fcb
commit baec7940a5
3 changed files with 17 additions and 19 deletions
+2 -9
View File
@@ -88,7 +88,7 @@ jobs:
docker-image:
runs-on: ubuntu-22.04
needs: validate
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: read
defaults:
@@ -143,14 +143,7 @@ jobs:
REPOSITORY_PATH="${RAW_REPOSITORY#/}"
IMAGE_REPOSITORY_PATH="$(printf '%s' "$REPOSITORY_PATH" | tr '[:upper:]' '[:lower:]')"
IMAGE_NAME="${REGISTRY_HOST}/${IMAGE_REPOSITORY_PATH}"
case "$RAW_REF" in
refs/heads/main|refs/heads/master)
IMAGE_TAG="latest"
;;
*)
IMAGE_TAG="${RAW_REF_NAME}"
;;
esac
IMAGE_TAG="${RAW_REF_NAME}"
{
echo "REGISTRY_HOST=${REGISTRY_HOST}"
echo "REPOSITORY_PATH=${REPOSITORY_PATH}"