2021-10-16 22:44:34 +00:00
|
|
|
name: Deploy GitHub Pages
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main # Set a branch to deploy
|
|
|
|
pull_request:
|
2021-10-16 22:50:59 +00:00
|
|
|
workflow_dispatch:
|
2021-10-16 22:44:34 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout Site
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: true # Fetch Hugo themes (true OR recursive)
|
|
|
|
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
|
|
|
|
|
|
|
- name: Setup Hugo
|
|
|
|
uses: peaceiris/actions-hugo@v2
|
|
|
|
with:
|
|
|
|
hugo-version: 'latest'
|
|
|
|
# extended: true
|
|
|
|
|
|
|
|
- name: Build Site
|
2021-10-16 23:15:45 +00:00
|
|
|
run: hugo --minify --source exampleSite
|
2021-10-16 22:44:34 +00:00
|
|
|
|
|
|
|
- name: Deploy Site
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: ./public
|