Update deploy.yml and deploy.sh

This commit is contained in:
Santiago Lo Coco 2022-02-10 17:00:07 -03:00
parent b168da7fea
commit 5988ae32d3
2 changed files with 6 additions and 6 deletions

View File

@ -36,16 +36,16 @@ jobs:
- name: Setup deploy options
id: setup
run: |
git config --global user.name "GitHub Action"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
if [[ ${GITHUB_REF} = refs/pull/*/merge ]]; then # pull request
git config --local user.name "$(git log --format=%an | head -n 1)"
git config --local user.email "$(git log --format=%ae | head -n 1)"
if [[ ${GITHUB_REF} = refs/pull/*/merge ]]; then
echo "::set-output name=SRC_BRANCH::${GITHUB_HEAD_REF}"
echo "::set-output name=NO_PUSH::--no-push"
elif [[ ${GITHUB_REF} = refs/heads/* ]]; then # branch, e.g. master, source etc
elif [[ ${GITHUB_REF} = refs/heads/* ]]; then
echo "::set-output name=SRC_BRANCH::${GITHUB_REF#refs/heads/}"
fi
echo "::set-output name=DEPLOY_BRANCH::gh-pages"
- name: Deploy website
run: yes | bin/deploy --verbose ${{ steps.setup.outputs.NO_PUSH }}
run: yes | bin/deploy.sh --verbose ${{ steps.setup.outputs.NO_PUSH }}
--src ${{ steps.setup.outputs.SRC_BRANCH }}
--deploy ${{ steps.setup.outputs.DEPLOY_BRANCH }}

View File

@ -7,7 +7,7 @@
SRC_BRANCH="master"
DEPLOY_BRANCH="gh-pages"
USAGE_MSG="usage: deploy [-h|--help] [-u|--user] [-s|--src SRC_BRANCH] [-d|--deploy DEPLOY_BRANCH] [--verbose] [--no-push]"
USAGE_MSG="usage: deploy.sh [-h|--help] [-u|--user] [-s|--src SRC_BRANCH] [-d|--deploy DEPLOY_BRANCH] [--verbose] [--no-push]"
while [[ $# > 0 ]]; do
key="$1"