File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change 1+ # Sample workflow for building and deploying a Hugo site to GitHub Pages
12name : Deploy Hugo site to Pages
23
34on :
5+ # Runs on pushes targeting the default branch
46 push :
57 branches : ["main"]
8+
9+ # Allows you to run this workflow manually from the Actions tab
610 workflow_dispatch :
711
12+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
813permissions :
914 contents : read
1015 pages : write
1116 id-token : write
1217
18+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
1320concurrency :
1421 group : " pages"
1522 cancel-in-progress : false
1623
24+ # Default to bash
1725defaults :
1826 run :
1927 shell : bash
2028
2129jobs :
30+ # Build job
2231 build :
2332 runs-on : ubuntu-latest
2433 env :
2534 HUGO_VERSION : 0.114.0
2635 steps :
2736 - name : Install Hugo CLI
2837 run : |
29- wget -O ${{ runner.temp }}/hugo.deb \
30- https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
31- sudo dpkg -i ${{ runner.temp }}/hugo.deb
32-
38+ wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
39+ && sudo dpkg -i ${{ runner.temp }}/hugo.deb
3340 - name : Install Dart Sass
3441 run : sudo snap install dart-sass
35-
3642 - name : Checkout
3743 uses : actions/checkout@v3
3844 with :
3945 submodules : recursive
40-
4146 - name : Setup Pages
4247 id : pages
4348 uses : actions/configure-pages@v3
44-
4549 - name : Install Node.js dependencies
46- run : |
47- if [[ -f package-lock.json || -f npm-shrinkwrap.json ]]; then
48- npm ci
49- fi
50-
50+ run : " [[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
5151 - name : Build with Hugo
5252 env :
53+ # For maximum backward compatibility with Hugo modules
5354 HUGO_ENVIRONMENT : production
5455 HUGO_ENV : production
5556 run : hugo --minify
56-
5757 - name : Upload artifact
5858 uses : actions/upload-pages-artifact@v2
5959 with :
6060 path : ./public
6161
62+ # Deployment job
6263 deploy :
6364 environment :
6465 name : github-pages
You can’t perform that action at this time.
0 commit comments