ci(global): syntax fixes on scripts + repo URL update on config

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@gmail.com>
This commit is contained in:
Andrei Jiroh Halili 2023-09-25 16:08:13 +00:00
parent 79659f3ebd
commit 41bafbec90
3 changed files with 6 additions and 5 deletions

View file

@ -1,4 +1,4 @@
#!/bin/env #!/bin/env bash
set -xe set -xe
SOURCEHUT_USERNAME=${SOURCEHUT_PAGES_SUBDOMAIN:-"ajhalili2006"} SOURCEHUT_USERNAME=${SOURCEHUT_PAGES_SUBDOMAIN:-"ajhalili2006"}

View file

@ -27,7 +27,7 @@ info() {
echo "info: $*" echo "info: $*"
} }
if [[ $_branch_name_git == "main" ]]; 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" 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"
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" 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"
@ -47,10 +47,11 @@ fi
if [[ $FF_DIRTY_DEPLOY == "true" ]]; then if [[ $FF_DIRTY_DEPLOY == "true" ]]; then
$DEPLOY_COMMAND --commit-dirty $DEPLOY_COMMAND --commit-dirty
else else
${DEPLOY_COMMAND} DEFAULT_COMMAND="npx wrangler pages publish ${_root_directory_git}/public --project-name ${CF_PAGES_PROJECT_NAME} --branch main --env production"
${DEPLOY_COMMAND:-$DEFAULT_COMMAND}
fi fi
if [[ $_branch_name_git == "main" ]]; 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
curl --oauth2-bearer "$SOURCEHUT_PAGES_TOKEN" \ curl --oauth2-bearer "$SOURCEHUT_PAGES_TOKEN" \
-Fcontent=@site-build.tar.gz \ -Fcontent=@site-build.tar.gz \

View file

@ -13,7 +13,7 @@ docs_dir: markdown
use_directory_urls: true use_directory_urls: true
# repos # repos
repo_url: https://mau.dev/ajhalili2006/tildeverse-web repo_url: https://mau.dev/andreijiroh.dev/website
edit_uri: edit/main/markdown edit_uri: edit/main/markdown
repo_name: source code repo_name: source code