ci(deploykit-pages): fix more outstanding issues

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@gmail.com>
This commit is contained in:
Andrei Jiroh Halili 2023-09-25 16:22:58 +00:00
parent 41bafbec90
commit fca7c26b17

View file

@ -28,9 +28,9 @@ info() {
} }
if [[ $_branch_name_git == "main" ]] || [[ $_branch_name_git == "HEAD" ]]; then if [[ $_branch_name_git == "main" ]] || [[ $_branch_name_git == "HEAD" ]]; then
DEPLOY_COMMAND="npx wrangler pages publish ${_root_directory_git}/public --project-name ${CF_PAGES_PROJECT_NAME} --branch ${_branch_name_git} --commit-hash ${_commit_sha} --env production" export DEPLOY_COMMAND="npx wrangler pages deploy ${_root_directory_git}/public --project-name ${CF_PAGES_PROJECT_NAME} --branch main --commit-hash ${_commit_sha} --env production"
elif [[ $CI_PIPELINE_SOURCE == "merge_request" ]]; then elif [[ $CI_PIPELINE_SOURCE == "merge_request" ]]; then
DEPLOY_COMMAND="npx wrangler pages publish ${_root_directory_git}/public --project-name ${CF_PAGES_PROJECT_NAME} --branch ${_branch_name_git} --commit-hash ${_commit_sha} --env pr-$CI_MERGE_REQUEST_ID" export DEPLOY_COMMAND="npx wrangler pages deploy ${_root_directory_git}/public --project-name ${CF_PAGES_PROJECT_NAME} --branch ${_branch_name_git} --commit-hash ${_commit_sha} --env pr-$CI_MERGE_REQUEST_ID"
fi fi
if ! git diff-index --quiet HEAD -- && [[ $FF_DIRTY_DEPLOY != "true" ]]; then if ! git diff-index --quiet HEAD -- && [[ $FF_DIRTY_DEPLOY != "true" ]]; then
@ -45,11 +45,12 @@ if [[ ! -d "$_root_directory_git/public" ]]; then
fi fi
if [[ $FF_DIRTY_DEPLOY == "true" ]]; then if [[ $FF_DIRTY_DEPLOY == "true" ]]; then
$DEPLOY_COMMAND --commit-dirty $DEPLOY_COMMAND --commit-dirty=true
else else
DEFAULT_COMMAND="npx wrangler pages publish ${_root_directory_git}/public --project-name ${CF_PAGES_PROJECT_NAME} --branch main --env production" DEFAULT_COMMAND="npx wrangler pages publish ${_root_directory_git}/public --project-name ${CF_PAGES_PROJECT_NAME} --branch main --env production"
${DEPLOY_COMMAND:-$DEFAULT_COMMAND} ${DEPLOY_COMMAND:-$DEFAULT_COMMAND}
fi fi
unset DEPLOY_COMMAND
if [[ $_branch_name_git == "main" ]] || [[ $_branch_name_git == "HEAD" ]]; then if [[ $_branch_name_git == "main" ]] || [[ $_branch_name_git == "HEAD" ]]; then
tar -C public -cvz . -f site-build.tar.gz tar -C public -cvz . -f site-build.tar.gz