Update way artifacts are uploaded to repository

Don't clear history of the artifact repo, push files as new commits
This commit is contained in:
Edoardo Lolletti 2026-08-18 15:47:15 +02:00
parent 9d09108aaf
commit 984416b33c

View file

@ -4,9 +4,20 @@ set -euo pipefail
cd $DEPLOY_DIR
git init
git checkout --orphan $DEPLOY_BRANCH
git remote add origin https://$DEPLOY_TOKEN@github.com/$DEPLOY_REPO.git
git config user.email github-actions[bot]@users.noreply.github.com
git config user.name "github-actions[bot]"
echo $GITHUB_SHA > commit
if ! git fetch -q origin $DEPLOY_BRANCH --depth 1; then
git checkout --orphan $DEPLOY_BRANCH
else
mkdir ./.tmp
mv ./* ./.tmp
git checkout $DEPLOY_BRANCH
rm -r ./*
mv ./.tmp/* .
rm -r ./.tmp
fi
git add -A .
git commit -qm "Deploy $DEPLOY_REPO to $DEPLOY_REPO:$DEPLOY_BRANCH"
git push -qf https://$DEPLOY_TOKEN@github.com/$DEPLOY_REPO.git $DEPLOY_BRANCH:$DEPLOY_BRANCH
git commit -qm "Deploy $DEPLOY_REPO to $DEPLOY_REPO:$DEPLOY_BRANCH" -qm "$GITHUB_SHA"
git push -qf origin $DEPLOY_BRANCH:$DEPLOY_BRANCH