-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (37 loc) · 1.05 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: GitHub Pages
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
submodules: recursive # fetch Hugo themes
fetch-depth: 0
- name: Init submodules
run: git submodule update --init --recursive
- uses: actions/cache@v3
with:
path: /tmp/hugo_cache
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Setup hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
extended: true
- name: Build
# remove --minify tag if you do not need it
# docs: https://gohugo.io/hugo-pipes/minification/
run: hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
keep_files: true
publish_branch: site