File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Expand file tree Collapse file tree 1 file changed +13
-14
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
21name : Deploy Hugo site to Pages
32
43on :
5- # Runs on pushes targeting the default branch
64 push :
75 branches : ["main"]
8-
9- # Allows you to run this workflow manually from the Actions tab
106 workflow_dispatch :
117
12- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
138permissions :
149 contents : read
1510 pages : write
1611 id-token : write
1712
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.
2013concurrency :
2114 group : " pages"
2215 cancel-in-progress : false
2316
24- # Default to bash
2517defaults :
2618 run :
2719 shell : bash
2820
2921jobs :
30- # Build job
3122 build :
3223 runs-on : ubuntu-latest
3324 env :
3425 HUGO_VERSION : 0.114.0
3526 steps :
3627 - name : Install Hugo CLI
3728 run : |
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
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+
4033 - name : Install Dart Sass
4134 run : sudo snap install dart-sass
35+
4236 - name : Checkout
4337 uses : actions/checkout@v3
4438 with :
4539 submodules : recursive
40+
4641 - name : Setup Pages
4742 id : pages
4843 uses : actions/configure-pages@v3
44+
4945 - name : Install Node.js dependencies
50- run : " [[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
46+ run : |
47+ if [[ -f package-lock.json || -f npm-shrinkwrap.json ]]; then
48+ npm ci
49+ fi
50+
5151 - name : Build with Hugo
5252 env :
53- # For maximum backward compatibility with Hugo modules
5453 HUGO_ENVIRONMENT : production
5554 HUGO_ENV : production
5655 run : hugo --minify
56+
5757 - name : Upload artifact
5858 uses : actions/upload-pages-artifact@v2
5959 with :
6060 path : ./public
6161
62- # Deployment job
6362 deploy :
6463 environment :
6564 name : github-pages
You can’t perform that action at this time.
0 commit comments