Skip to content

Commit 32d8719

Browse files
sebbycorpclaude
andcommitted
Add GitHub Actions workflow for GitHub Pages deployment
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b959cb2 commit 32d8719

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy Hugo to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
defaults:
18+
run:
19+
shell: bash
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
env:
25+
HUGO_VERSION: 0.154.3
26+
steps:
27+
- name: Install Hugo
28+
run: |
29+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
30+
sudo dpkg -i ${{ runner.temp }}/hugo.deb
31+
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Setup Pages
36+
id: pages
37+
uses: actions/configure-pages@v5
38+
39+
- name: Build with Hugo
40+
env:
41+
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
42+
run: |
43+
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: ./public
49+
50+
deploy:
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
runs-on: ubuntu-latest
55+
needs: build
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)