1- # Sample workflow for building and deploying a Hugo site to GitHub Pages
2- name : Deploy Hugo site to Pages
3-
1+ name : Build & Deploy
42on :
5- # Runs on pushes targeting the default branch
63 push :
4+ paths-ignore :
5+ - " LICENSE"
6+ - " README.md"
77 branches :
88 - main
9-
10- # Allows you to run this workflow manually from the Actions tab
119 workflow_dispatch :
1210
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.
11+ # Allow one concurrent deployment
2112concurrency :
2213 group : " pages"
23- cancel-in-progress : false
14+ cancel-in-progress : true
2415
2516# Default to bash
2617defaults :
2718 run :
2819 shell : bash
2920
21+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
22+ permissions :
23+ contents : read
24+ pages : write
25+ id-token : write
26+
3027jobs :
3128 # Build job
3229 build :
@@ -36,35 +33,28 @@ jobs:
3633 steps :
3734 - name : Install Hugo CLI
3835 run : |
39- wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_ ${HUGO_VERSION}_linux-amd64.deb \
36+ wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_ ${HUGO_VERSION}_linux-amd64.deb \
4037 && sudo dpkg -i ${{ runner.temp }}/hugo.deb
41- - name : Install Dart Sass
42- run : sudo snap install dart-sass
4338 - name : Checkout
44- uses : actions/checkout@v3
39+ uses : actions/checkout@v4
4540 with :
46- submodules : recursive
47- fetch-depth : 0
41+ ref : main
4842 - name : Setup Pages
4943 id : pages
50- uses : actions/configure-pages@v3
51- - name : Install Node.js dependencies
52- run : " [[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
44+ uses : actions/configure-pages@v5
45+ - name : Get Theme
46+ run : git submodule update --init --recursive
47+ - name : Update theme to Latest commit
48+ run : git submodule update --remote --merge
5349 - name : Build with Hugo
54- env :
55- # For maximum backward compatibility with Hugo modules
56- HUGO_ENVIRONMENT : production
57- HUGO_ENV : production
5850 run : |
5951 hugo \
60- --gc \
61- --minify \
62- --baseURL "${{ steps.pages.outputs.base_url }}/"
52+ --buildDrafts --gc --minify \
53+ --baseURL ${{ steps.pages.outputs.base_url }}
6354 - name : Upload artifact
64- uses : actions/upload-pages-artifact@v1
55+ uses : actions/upload-pages-artifact@v3
6556 with :
6657 path : ./public
67-
6858 # Deployment job
6959 deploy :
7060 environment :
7565 steps :
7666 - name : Deploy to GitHub Pages
7767 id : deployment
78- uses : actions/deploy-pages@v2
68+ uses : actions/deploy-pages@v4
0 commit comments