Add links #44
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: build site | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout codebase | |
uses: actions/checkout@v4 | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.119.0' | |
extended: true | |
- name: Delete public/ | |
run: rm -rf public/ | |
- name: Build site | |
run: hugo --gc --minify --enableGitInfo | |
- name: Deploy site to deploy branch | |
run: | | |
git worktree add deploy | |
git config user.name "Deploy from CI" | |
git config user.email "" | |
cd deploy | |
# Delete the ref to avoid keeping history. | |
git update-ref -d refs/heads/deploy | |
rm -rf * | |
mv ../public/* . | |
git add . | |
git commit -m "Deploy $GITHUB_SHA to deploy" | |
git push --force --set-upstream origin deploy |