fix: CI: clear repo before publishing site
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Aravinth Manivannan 2022-12-18 22:35:55 +05:30
parent da917bce95
commit f5c8c7a737
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
2 changed files with 7 additions and 4 deletions

View file

@ -8,10 +8,9 @@ ci-deploy: ## Deploy from CI/CD. Only call from within CI
fi fi
git config --global user.email "${CI_COMMIT_AUTHOR_EMAIL}" git config --global user.email "${CI_COMMIT_AUTHOR_EMAIL}"
git config --global user.name "${CI_COMMIT_AUTHOR}" git config --global user.name "${CI_COMMIT_AUTHOR}"
./scripts/ci.sh --publish librepages dist "${CI_COMMIT_AUTHOR} <${CI_COMMIT_AUTHOR_EMAIL}>" find
./scripts/ci.sh --init "$$GITEA_WRITE_DEPLOY_KEY" ./scripts/ci.sh --init "$$GITEA_WRITE_DEPLOY_KEY"
./scripts/ci.sh --deploy ${LIBREPAGES_DEPLOY_SECRET} librepages ./scripts/ci.sh --deploy librepages dist "${CI_COMMIT_AUTHOR} <${CI_COMMIT_AUTHOR_EMAIL}>" ${LIBREPAGES_DEPLOY_SECRET} librepages
./scripts/ci.sh --clean
lint: ## Lint codebase lint: ## Lint codebase
cargo fmt -v --all -- --emit files cargo fmt -v --all -- --emit files

View file

@ -89,6 +89,7 @@ write_to_branch() {
git switch $1 git switch $1
fi fi
cd ..
git rm -rf . git rm -rf .
/bin/rm -rf * /bin/rm -rf *
cp -r $tmp_dir/* . cp -r $tmp_dir/* .
@ -101,6 +102,7 @@ write_to_branch() {
--message="new deploy: $(date --iso-8601=seconds)" --message="new deploy: $(date --iso-8601=seconds)"
fi fi
git checkout $original_branch git checkout $original_branch
find
} }
# $1: Pages API secret # $1: Pages API secret
@ -148,7 +150,9 @@ then
help help
exit -1 exit -1
fi fi
deploy $2 $3 write_to_branch $2 $3 $4
deploy $5 $6
clean
elif match_arg $1 '-h' '--help' elif match_arg $1 '-h' '--help'
then then
help help