Skip to content

Commit deec5bc

Browse files
aleixrmtinova
authored andcommitted
F #-: Adds hugo build check (#454)
Signed-off-by: Aleix Ramírez <aramirez@opennebula.io> (cherry picked from commit 97ab01c)
1 parent 3b540f3 commit deec5bc

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Hugo Site Build Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Default to bash
12+
defaults:
13+
run:
14+
shell: bash
15+
16+
jobs:
17+
# Build and publish job
18+
build:
19+
runs-on: ubuntu-latest
20+
env:
21+
HUGO_VERSION: 0.145.0
22+
steps:
23+
- name: Install Hugo CLI
24+
run: |
25+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
26+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
27+
- name: Install Dart Sass
28+
run: sudo snap install dart-sass
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
with:
32+
submodules: recursive
33+
- name: Install Node.js
34+
uses: actions/setup-node@v3
35+
with:
36+
node-version: '20'
37+
- name: Install Node.js dependencies
38+
run: npm install
39+
- name: Add node_modules to PATH
40+
run: echo "$HOME/.npm-global/bin" >> $GITHUB_PATH
41+
- name: Build with Hugo
42+
env:
43+
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
44+
HUGO_ENVIRONMENT: ci
45+
PATH: ${{ runner.path }}:/usr/local/bin:/usr/bin:/bin:/node_modules/.bin
46+
run: |
47+
npx postcss --version # Verify PostCSS installation
48+
hugo \
49+
--minify \
50+
--config hugo.toml

0 commit comments

Comments
 (0)