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