-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.68 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
45
46
47
48
49
50
51
52
name: Hugo Website Deployment
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
submodules: recursive # Fetch the Docsy theme
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.109.0"
extended: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.12.1'
cache: 'npm'
# The action defaults to search for the dependency file (package-lock.json,
# npm-shrinkwrap.json or yarn.lock) in the repository root, and uses its
# hash as a part of the cache key.
# https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data
cache-dependency-path: '**/package-lock.json'
- run: npm ci
- name: Build
# remove --minify tag if you do not need it
# docs: https://gohugo.io/hugo-pipes/minification/
run: hugo
#run: hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.TOKEN_FOR_HUGO }}
#external_repository: <username>/<username>.github.io
publish_dir: ./public
# keep_files: true <-- usually, all files in the deployment folder are replaced
#user_name: Mullana
#user_email: [email protected]
#publish_branch: main
# cname: example.com <-- necessary when a custom domain is used