ci(deploy): fix image cleanup and shorten notifications
This commit is contained in:
@@ -28,10 +28,7 @@ if [ -z "$notify_url" ]; then
|
||||
fi
|
||||
|
||||
deploy_env="${DEPLOY_ENV:-unknown}"
|
||||
image_tag="${IMAGE_VERSION_TAG:-unknown}"
|
||||
job_status="${ACTION_JOB_STATUS:-unknown}"
|
||||
workflow_name="${GITHUB_WORKFLOW:-Docker Image}"
|
||||
repository="${GITHUB_REPOSITORY:-cozsweet-frontend-nextjs}"
|
||||
|
||||
run_url=""
|
||||
if [ -n "${GITHUB_SERVER_URL:-}" ] && [ -n "${GITHUB_REPOSITORY:-}" ] && [ -n "${GITHUB_RUN_ID:-}" ]; then
|
||||
@@ -42,16 +39,8 @@ if [ -z "$run_url" ]; then
|
||||
fi
|
||||
|
||||
export ACTION_NOTIFY_MESSAGE="$(cat <<EOF
|
||||
Gitea workflow finished.
|
||||
|
||||
Workflow: $workflow_name
|
||||
Repository: $repository
|
||||
Branch: $branch_name
|
||||
Environment: $deploy_env
|
||||
Commit: $short_sha
|
||||
Image: $image_tag
|
||||
Status: $job_status
|
||||
Run: $run_url
|
||||
$job_status $deploy_env/$branch_name $short_sha
|
||||
$run_url
|
||||
EOF
|
||||
)"
|
||||
|
||||
|
||||
@@ -57,11 +57,11 @@ prune_project_images() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
local image_repo="${IMAGE%%:*}"
|
||||
local image_repo="${IMAGE%:*}"
|
||||
local image_tag="${IMAGE##*:}"
|
||||
local tag_prefix="${image_tag%%-*}-"
|
||||
|
||||
if [ -z "$image_repo" ] || [ "$image_repo" = "$IMAGE" ] || [ -z "$tag_prefix" ]; then
|
||||
if [ -z "$image_repo" ] || [ "$image_repo" = "$IMAGE" ] || [ -z "$image_tag" ] || [ "$image_tag" = "$IMAGE" ] || [ -z "$tag_prefix" ]; then
|
||||
echo "Skip project image prune: could not parse image repo/tag from $IMAGE"
|
||||
return 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user