Update pages.yml
This commit is contained in:
parent
42d91e95aa
commit
337f845312
1 changed files with 2 additions and 20 deletions
18
.github/workflows/pages.yml
vendored
18
.github/workflows/pages.yml
vendored
|
|
@ -15,18 +15,11 @@ jobs:
|
||||||
COMMITER_EMAIL="${GITHUB_ACTOR}-@users.noreply.github.com"
|
COMMITER_EMAIL="${GITHUB_ACTOR}-@users.noreply.github.com"
|
||||||
REMOTE_BRANCH_EXISTS=$(git ls-remote --heads ${REMOTE} ${target_branch} | wc -l)
|
REMOTE_BRANCH_EXISTS=$(git ls-remote --heads ${REMOTE} ${target_branch} | wc -l)
|
||||||
|
|
||||||
echo "COMMITER_NAME: ${COMMITER_NAME}"
|
|
||||||
echo "COMMITER_EMAIL: ${COMMITER_EMAIL}"
|
|
||||||
echo "REMOTE: ${REMOTE}"
|
|
||||||
|
|
||||||
|
|
||||||
mkdir /tmp/github-pages
|
mkdir /tmp/github-pages
|
||||||
cd /tmp/github-pages
|
cd /tmp/github-pages
|
||||||
|
|
||||||
if $keep_history && [ $REMOTE_BRANCH_EXISTS -ne 0 ]
|
if $keep_history && [ $REMOTE_BRANCH_EXISTS -ne 0 ]
|
||||||
then
|
then
|
||||||
echo remote exists
|
|
||||||
echo clone repo
|
|
||||||
git clone --quiet --branch ${target_branch} --depth 1 ${REMOTE} .
|
git clone --quiet --branch ${target_branch} --depth 1 ${REMOTE} .
|
||||||
else
|
else
|
||||||
echo remote does not exist
|
echo remote does not exist
|
||||||
|
|
@ -43,29 +36,18 @@ jobs:
|
||||||
then
|
then
|
||||||
echo '⚠️ There are no changes to commit, stopping.'
|
echo '⚠️ There are no changes to commit, stopping.'
|
||||||
else
|
else
|
||||||
echo
|
|
||||||
echo "keep_history: $keep_history"
|
|
||||||
echo "REMOTE_BRANCH_EXISTS: $REMOTE_BRANCH_EXISTS"
|
|
||||||
echo "DIRTY: $DIRTY"
|
|
||||||
echo log before commit
|
|
||||||
git log
|
git log
|
||||||
git config user.name ${COMMITER_NAME}
|
git config user.name ${COMMITER_NAME}
|
||||||
git config user.email ${COMMITER_EMAIL}
|
git config user.email ${COMMITER_EMAIL}
|
||||||
git status --porcelain
|
|
||||||
git add --all .
|
git add --all .
|
||||||
git commit -m "DIST to ${target_branch}"
|
git commit -m "DIST to ${target_branch}"
|
||||||
echo
|
|
||||||
echo log after commit
|
|
||||||
git log
|
|
||||||
|
|
||||||
echo 🏃 Deploying ${build_dir} directory to ${target_branch} branch on ${repo} repo
|
echo 🏃 Deploying ${build_dir} directory to ${target_branch} branch on ${repo} repo
|
||||||
|
|
||||||
if [ $keep_history == false]
|
if [ $keep_history == false]
|
||||||
then
|
then
|
||||||
echo pushing to remote
|
|
||||||
git push --quiet ${REMOTE} ${target_branch}
|
git push --quiet ${REMOTE} ${target_branch}
|
||||||
else
|
else
|
||||||
echo force pushing to remote
|
|
||||||
git push --quiet --force ${REMOTE} ${target_branch}
|
git push --quiet --force ${REMOTE} ${target_branch}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue