Skip to content

Commit 7fff821

Browse files
authored
Create hugo.yml
1 parent 9e3d71f commit 7fff821

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/hugo.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Sample workflow for building and deploying a Hugo site to GitHub Pages
2+
name: Deploy Hugo site to Pages
3+
4+
on:
5+
push:
6+
branches: ["main"]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
env:
26+
HUGO_VERSION: 0.128.0
27+
steps:
28+
- name: Install Hugo CLI
29+
run: |
30+
wget -O ${{ runner.temp }}/hugo.deb 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+
- name: Install Dart Sass
33+
run: sudo snap install dart-sass
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
with:
37+
submodules: recursive
38+
- name: Setup Pages
39+
id: pages
40+
uses: actions/configure-pages@v5
41+
- name: Install Node.js dependencies
42+
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
43+
- name: Build with Hugo
44+
env:
45+
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
46+
HUGO_ENVIRONMENT: production
47+
run: |
48+
# The command below builds your site into the default "public" directory.
49+
# (If your config uses a different output directory, update accordingly.)
50+
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
51+
- name: Upload artifact
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: ./public
55+
56+
deploy:
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
runs-on: ubuntu-latest
61+
needs: build
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)