mirror of
https://github.com/edo9300/ygopro-core
synced 2026-08-25 16:23:07 -04:00
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:
parent
9d09108aaf
commit
984416b33c
1 changed files with 14 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue