draft #207
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Hugo | |
run: sudo snap install hugo | |
- name: Build | |
run: hugo | |
- name: Deploy | |
run: | | |
git fetch | |
git branch -D gh-pages || true | |
git checkout -b gh-pages | |
shopt -s extglob | |
rm -r !(public|CNAME) | |
mv public/* . | |
rm -r public/ | |
git add . | |
git config user.name 'ZanSara' | |
git config user.email '[email protected]' | |
git commit -m 'deploy' || true | |
git push -u origin gh-pages --force || true |