Skip to content

Commit 2dfe1fd

Browse files
committed
Added GitHub Pages workflow
1 parent ede833a commit 2dfe1fd

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

.github/workflows/hugo.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Sample workflow for building and deploying a Hugo site to GitHub Pages
2+
name: Deploy Documentation
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches:
8+
- doc/built-in-doc
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
20+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
21+
concurrency:
22+
group: "pages"
23+
cancel-in-progress: false
24+
25+
# Default to bash
26+
defaults:
27+
run:
28+
shell: bash
29+
working-directory: Documentation
30+
31+
jobs:
32+
# Build job
33+
build:
34+
runs-on: ubuntu-latest
35+
env:
36+
HUGO_VERSION: 0.147.2
37+
HUGO_ENVIRONMENT: production
38+
TZ: America/Los_Angeles
39+
steps:
40+
- name: Install Hugo CLI
41+
run: |
42+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
43+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
44+
- name: Install Dart Sass
45+
run: sudo snap install dart-sass
46+
- name: Checkout
47+
uses: actions/checkout@v4
48+
with:
49+
submodules: recursive
50+
fetch-depth: 0
51+
- name: Setup Pages
52+
id: pages
53+
uses: actions/configure-pages@v5
54+
- name: Install Node.js dependencies
55+
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
56+
- name: Cache Restore
57+
id: cache-restore
58+
uses: actions/cache/restore@v4
59+
with:
60+
path: |
61+
${{ runner.temp }}/hugo_cache
62+
key: hugo-${{ github.run_id }}
63+
restore-keys:
64+
hugo-
65+
- name: Configure Git
66+
run: git config core.quotepath false
67+
- name: Build with Hugo
68+
run: |
69+
hugo \
70+
--gc \
71+
--minify \
72+
--baseURL "${{ steps.pages.outputs.base_url }}/" \
73+
--cacheDir "${{ runner.temp }}/hugo_cache"
74+
- name: Cache Save
75+
id: cache-save
76+
uses: actions/cache/save@v4
77+
with:
78+
path: |
79+
${{ runner.temp }}/hugo_cache
80+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
81+
- name: Upload artifact
82+
uses: actions/upload-pages-artifact@v3
83+
with:
84+
path: ./public
85+
86+
# Deployment job
87+
deploy:
88+
environment:
89+
name: github-pages
90+
url: ${{ steps.deployment.outputs.page_url }}
91+
runs-on: ubuntu-latest
92+
needs: build
93+
steps:
94+
- name: Deploy to GitHub Pages
95+
id: deployment
96+
uses: actions/deploy-pages@v4

Documentation/hugo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ disablePathToLower = true
1212
# Required if you want to render robots.txt template
1313
enableRobotsTXT = true
1414

15+
[caches]
16+
[caches.images]
17+
dir = ':cacheDir/images'
18+
1519
# Needed for mermaid shortcodes
1620
[markup]
1721
[markup.goldmark.renderer]

0 commit comments

Comments
 (0)