-
Notifications
You must be signed in to change notification settings - Fork 56
52 lines (43 loc) · 1.23 KB
/
publish-website.yaml
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: "publish-website"
on:
pull_request:
paths:
- "website/**"
push:
branches:
- "main"
paths:
- "website/**"
workflow_dispatch:
jobs:
publish-website:
runs-on: ubuntu-latest
steps:
- name: "Check out the repository"
uses: actions/checkout@v4
with:
submodules: true # Fetch Hugo theme
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: "Setup Hugo"
uses: peaceiris/actions-hugo@v3
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@v4
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 == 'main'
uses: JamesIves/github-pages-deploy-action@v4.7.2
with:
branch: gh-pages
folder: public
commit-message: "ci: publish website for ${{ github.sha }}"
clean-exclude: |
docs