ci: main branch should be considered as prod deployment
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b66eea4069
commit
8d7f16b231
@ -3,11 +3,15 @@
|
|||||||
BRANCH_NAME="$(git branch --show-current)"
|
BRANCH_NAME="$(git branch --show-current)"
|
||||||
|
|
||||||
__netlify_upload() {
|
__netlify_upload() {
|
||||||
|
local production="$DEPLOY_PRODUCTION"
|
||||||
|
[[ -z "$production" ]] && production="false"
|
||||||
|
[[ "$BRANCH_NAME" = "main" ]] && production="true"
|
||||||
|
|
||||||
curl -sL \
|
curl -sL \
|
||||||
-H "Content-Type: application/zip" \
|
-H "Content-Type: application/zip" \
|
||||||
-H "Authorization: Bearer ${NETLIFY_API_KEY}" \
|
-H "Authorization: Bearer ${NETLIFY_API_KEY}" \
|
||||||
--data-binary "@${1}" \
|
--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() {
|
__netlify_get_deploy() {
|
||||||
|
Loading…
Reference in New Issue
Block a user