2021-10-16 04:31:21 -04:00
|
|
|
name: Deploy to Github Pages
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
pull_request:
|
|
|
|
branches: [master]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2023-07-12 06:35:18 -04:00
|
|
|
permissions:
|
|
|
|
# Give the default GITHUB_TOKEN write permission to commit and push the
|
|
|
|
# added or changed files to the repository.
|
|
|
|
contents: write
|
|
|
|
|
2021-10-16 04:31:21 -04:00
|
|
|
steps:
|
2023-08-15 08:08:28 -04:00
|
|
|
- uses: actions/checkout@v3
|
2021-10-16 04:31:21 -04:00
|
|
|
|
|
|
|
- name: Cache Hugo resources
|
2023-08-15 08:08:28 -04:00
|
|
|
uses: actions/cache@v3
|
2021-10-16 04:31:21 -04:00
|
|
|
env:
|
|
|
|
cache-name: cache-hugo-resources
|
|
|
|
with:
|
|
|
|
path: resources
|
|
|
|
key: ${{ env.cache-name }}
|
|
|
|
|
2023-08-15 08:08:28 -04:00
|
|
|
- uses: actions/setup-go@v4
|
2021-10-16 04:31:21 -04:00
|
|
|
with:
|
|
|
|
go-version: "^1.17.0"
|
|
|
|
- run: go version
|
|
|
|
|
|
|
|
- name: Setup Hugo
|
|
|
|
uses: peaceiris/actions-hugo@v2
|
|
|
|
with:
|
|
|
|
hugo-version: "latest"
|
|
|
|
extended: true
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: hugo --minify --gc
|
|
|
|
|
|
|
|
- name: Deploy 🚀
|
2023-08-15 08:08:28 -04:00
|
|
|
uses: JamesIves/github-pages-deploy-action@v4
|
2021-10-16 04:31:21 -04:00
|
|
|
with:
|
|
|
|
branch: gh-pages
|
|
|
|
folder: public
|
|
|
|
clean: true
|
|
|
|
single-commit: true
|