ci: main branch should be considered as prod deployment

This commit is contained in:
鲁树人 2023-06-09 01:17:07 +01:00
parent 240b7ab927
commit b3d6759673

View File

@ -3,11 +3,15 @@
BRANCH_NAME="$(git branch --show-current)"
__netlify_upload() {
local production="$DEPLOY_PRODUCTION"
[[ -z "$production" ]] && production="false"
[[ "$BRANCH_NAME" = "main" ]] && production="true"
curl -sL \
-H "Content-Type: application/zip" \
-H "Authorization: Bearer ${NETLIFY_API_KEY}" \
--data-binary "@${1}" \
"https://api.netlify.com/api/v1/sites/${NETLIFY_SITE_ID}/deploys?branch=${BRANCH_NAME}"
"https://api.netlify.com/api/v1/sites/${NETLIFY_SITE_ID}/deploys?branch=${BRANCH_NAME}&production=${production}"
}
__netlify_get_deploy() {