Skip to content

Commit be9dcd6

Browse files
author
John Mee
committed
add github web pages build and deploy
1 parent fbd36c6 commit be9dcd6

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/hugo.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Hugo Build and Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Hugo
16+
uses: peaceiris/actions-hugo@v3
17+
with:
18+
hugo-version: latest # Or specify a version like 'v0.120.0'
19+
# extended: true # Set to true if using Hugo extended
20+
21+
- name: Build with Hugo
22+
run: hugo --destination public
23+
24+
- name: Upload artifact
25+
uses: actions/upload-pages-artifact@v4
26+
with:
27+
path: ./public
28+
29+
deploy:
30+
runs-on: ubuntu-latest
31+
needs: build
32+
permissions:
33+
pages: write
34+
id-token: write
35+
environment:
36+
name: github-pages
37+
url: ${{ steps.deployment.outputs.page_url }}
38+
steps:
39+
- name: Deploy to GitHub Pages
40+
id: deployment
41+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)