-
Notifications
You must be signed in to change notification settings - Fork 9
73 lines (62 loc) · 1.96 KB
/
hugo.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
name: Hugo (CD)
on:
# Only deploy when it is accepted for production
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
env:
HUGO_CACHEDIR: /tmp/hugo_cache/
HUGO_BASE_URL: "https://botlabs-gg.github.io/yagpdb-docs-v2"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: latest
# We use the extended version just to be on the safe side.
# It is recommended anyway.
extended: true
- name: Cache Hugo modules
uses: actions/cache@v3
with:
path: ${{ env.HUGO_CACHEDIR }}
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Build website
# See https://discourse.gohugo.io/t/solved-what-should-be-used-for-the-value-of-site-baseurl/5896
# for why we set baseURL here and not in hugo.toml.
run: hugo mod vendor && hugo --minify --baseURL=${{ env.HUGO_BASE_URL }}
- name: Setup Pages
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
id: pages
uses: actions/configure-pages@v4
- name: Upload artifact
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: actions/upload-pages-artifact@v2
with:
path: ./public
deploy:
# Only deploy if it's actually on production branch
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3