name: Hugo Build and Deploy
-on: push
+on:
+ push:
+ branches:
+ - main
+ - master
jobs:
gh-pages:
main-repo:
runs-on: ubuntu-latest
steps:
- - name: Check repo
- run: |
- echo $GITHUB_REPOSITORY
- [[ "$(basename "${GITHUB_REPOSITORY}")" = "hayao0819.github.io" ]] && exit 0
- name: Checkout
uses: actions/checkout@v2
with:
echo "Nothing has been commited"
fi
git pull --allow-unrelated-histories origin master
- git push origin master
-
+ git checkout -b gh-pages
+ git push origin gh-pages
+
\ No newline at end of file