1
1
# Sample workflow for building and deploying a Hugo site to GitHub Pages
2
- name : Deploy Hugo site to Pages
2
+ name : Deploy documentation to Github Pages
3
3
4
4
on :
5
5
# Runs on pushes targeting the default branch
6
- push :
6
+ pull_request :
7
+ branches :
8
+ - development
9
+ push :
7
10
branches :
8
11
- master
9
12
10
- # Allows you to run this workflow manually from the Actions tab
11
- workflow_dispatch :
12
-
13
13
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14
14
permissions :
15
15
contents : read
16
16
pages : write
17
17
id-token : write
18
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
19
concurrency :
22
20
group : " pages"
23
21
cancel-in-progress : false
@@ -29,22 +27,32 @@ defaults:
29
27
30
28
jobs :
31
29
# Build job
32
- build :
30
+ build-documentation :
33
31
runs-on : ubuntu-latest
34
32
env :
35
33
HUGO_VERSION : 0.123.7
36
34
steps :
35
+
37
36
- name : Install Hugo CLI
38
37
run : |
39
38
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
40
39
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
41
40
- name : Install Dart Sass
42
41
run : sudo snap install dart-sass
42
+ - name : Use Node.js
43
+ uses : actions/setup-node@v4
44
+ with :
45
+ node-version : ' 20.x'
43
46
- name : Checkout
44
47
uses : actions/checkout@v4
45
48
with :
46
49
submodules : recursive
47
50
fetch-depth : 0
51
+ - name : Update npm
52
+ run : npm install -g npm@10.5.0
53
+ - name : Install dependencies
54
+ run : npm install
55
+ working-directory : docs
48
56
- name : Setup Pages
49
57
id : pages
50
58
uses : actions/configure-pages@v4
@@ -55,25 +63,26 @@ jobs:
55
63
# For maximum backward compatibility with Hugo modules
56
64
HUGO_ENVIRONMENT : production
57
65
HUGO_ENV : production
66
+ working-directory : docs
58
67
run : |
59
68
hugo \
60
69
--gc \
61
70
--minify \
62
71
--baseURL "${{ steps.pages.outputs.base_url }}/"
63
72
- name : Upload artifact
64
- uses : actions/upload-pages-artifact@v2
73
+ uses : actions/upload-pages-artifact@v3
65
74
with :
66
- path : ./public
75
+ path : ./docs/ public
67
76
68
77
# Deployment job
69
- deploy :
78
+ deploy-to-pages :
70
79
environment :
71
- name : github -pages
80
+ name : development -pages
72
81
url : ${{ steps.deployment.outputs.page_url }}
73
82
runs-on : ubuntu-latest
74
- needs : build
83
+ needs : build-documentation
75
84
steps :
76
85
- name : Deploy to GitHub Pages
77
86
id : deployment
78
- uses : actions/deploy-pages@v3
87
+ uses : actions/deploy-pages@v4
79
88
0 commit comments