55 lines (44 loc) · 1.32 KB
/
website.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
53
54
55
---
name: "Website"
on:
pull_request:
paths:
- "website/**"
push:
branches:
- "master"
paths:
- "website/**"
workflow_dispatch:
jobs:
publish:
name: "Publish website"
runs-on: "ubuntu-latest"
steps:
- name: "Check out repository"
uses: "actions/checkout@v2"
with:
submodules: true # Fetch Hugo theme
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: "Setup Hugo"
uses: "peaceiris/actions-hugo@v2"
with:
hugo-version: "0.92.2"
extended: true
- name: "Build website with Hugo"
run: "hugo --minify --source 'website' --destination '../public'"
- name: "Upload generated artifact"
if: "github.event_name == 'pull_request'"
uses: "actions/upload-artifact@v2"
with:
name: "website"
path: "${{ github.workspace }}/public"
- name: "Deploy website to GitHub Pages"
if: "(github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name == 'master'"
uses: "JamesIves/github-pages-deploy-action@v4.2.5"
with:
branch: "gh-pages"
folder: "public"
commit-message: "ci: publish website for ${{ github.sha }}"
clean-exclude: |
docs