forked from hugo-themes/toha-example-site
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 968 Bytes
/
deploy-site.yaml
File metadata and controls
45 lines (37 loc) · 968 Bytes
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
name: Deploy to Github Pages
# run when a commit is pushed to "source" branch
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# checkout to the commit that has been pushed
- uses: actions/checkout@v3
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2.6.0
with:
# hugo-version: 'latest'
hugo-version: '0.134.0'
extended: true
- name: Update Hugo Modules
run: hugo mod tidy
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install node modules
run: |
hugo mod npm pack
npm install
- name: Build
run: hugo --minify
# push the generated content into the `gh-pages` branch.
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.9.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./public