Newer
Older
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
#
# Publish GO HUGO GitLab Pages Site using Go Modules option
# Themes and template reference using GO Module system
#
stages:
- validate
- publish
test:
image: registry.gitlab.com/pages/hugo/hugo_extended:latest
stage: validate
before_script:
# Add Go Module dependencies
- apk --no-cache add git
- apk --no-cache add go
script:
# Test Site Generation Templates
- hugo -D -E -F
only:
- dev
pages:
image: registry.gitlab.com/pages/hugo/hugo_extended:latest
stage: publish
before_script:
# Add Go Module dependencies
- apk --no-cache add git
- apk --no-cache add go
script:
# Generate Site from Repository Project
- |
echo "Add HUGO Configuration from CI-variables. "
echo "============================================="
echo "baseURL: '$CI_PAGES_URL'" >> config/$CI_JOB_NAME/config.yml
echo "title: '$CI_PROJECT_TITLE'" >> config/$CI_JOB_NAME/config.yml
- hugo config --environment $CI_JOB_NAME
- hugo -D -E -F --environment $CI_JOB_NAME
artifacts:
paths:
- public
only:
- main