2020-08-24 19:27:11 +00:00
|
|
|
#!/bin/bash -ex
|
2024-06-12 08:44:42 +00:00
|
|
|
pnpm run build
|
2020-08-24 19:27:11 +00:00
|
|
|
|
2022-04-15 14:53:08 +00:00
|
|
|
DEPLOYMENT_REPO=${1:-git@codeberg.org:Codeberg-Infrastructure/static-deployments}
|
|
|
|
DEPLOYMENT_BRANCH=${2:-docs}
|
2020-08-24 19:27:11 +00:00
|
|
|
rm -rf pages.git
|
2022-04-15 14:53:08 +00:00
|
|
|
mkdir pages.git
|
|
|
|
( cd pages.git && git init -b "$DEPLOYMENT_BRANCH" )
|
2020-08-24 19:27:11 +00:00
|
|
|
rsync -av _site/* pages.git/
|
2022-05-18 16:42:20 +00:00
|
|
|
echo "docs.codeberg.org" > pages.git/.domains
|
2020-08-24 19:27:11 +00:00
|
|
|
( cd pages.git && git add -A ) ## add all generated files
|
2022-04-15 14:53:08 +00:00
|
|
|
( cd pages.git && git commit -m "Deployment at $(date -u -Is)" ) ## commit all
|
|
|
|
( cd pages.git && git remote add origin "$DEPLOYMENT_REPO" )
|
|
|
|
( cd pages.git && git push -f origin "$DEPLOYMENT_BRANCH" ) ## force-push and rewrite (empty) history
|