ci(gitlab-ci): update deploy scripts and add .env.ci managed by dotenvx

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.xyz>
This commit is contained in:
Andrei Jiroh Halili 2024-10-12 19:10:03 +00:00
parent e954a7fa74
commit cc340223f9
No known key found for this signature in database
GPG key ID: 67BFC91B3DA12BE8
4 changed files with 45 additions and 26 deletions

24
bin/deploy.sh Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -ea
if [[ $DEBUG != "" ]]; then
set -x
fi
_root_directory_git=$(git rev-parse --show-toplevel)
warn() {
echo "warning: $*"
}
error() {
echo "error: $*"
}
info() {
echo "info: $*"
}
if [[ $CI == "true" ]] && [[ $CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web" ]]
&& [[ $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ]]; then
npx wrangler pages publish ${_root_directory_git}/public --project-name ${CF_PAGES_PROJECT_NAME} --branch main
fi