Skip to content

Commit b88869e

Browse files
DavidLiedleclaude
andcommitted
Add GitHub Pages deployment workflow
- Create GitHub Actions workflow for automatic Hugo site deployment - Update baseURL to GitHub Pages URL - Configure Hugo build and deployment pipeline 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 33c7197 commit b88869e

File tree

2 files changed

+75
-1
lines changed

2 files changed

+75
-1
lines changed

.github/workflows/hugo.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Deploy Hugo site to Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["main"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
# Default to bash
24+
defaults:
25+
run:
26+
shell: bash
27+
28+
jobs:
29+
# Build job
30+
build:
31+
runs-on: ubuntu-latest
32+
env:
33+
HUGO_VERSION: 0.128.0
34+
steps:
35+
- name: Install Hugo CLI
36+
run: |
37+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
38+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
39+
- name: Install Dart Sass
40+
run: sudo snap install dart-sass
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
with:
44+
submodules: recursive
45+
- name: Setup Pages
46+
id: pages
47+
uses: actions/configure-pages@v5
48+
- name: Install Node.js dependencies
49+
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
50+
- name: Build with Hugo
51+
env:
52+
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
53+
HUGO_ENVIRONMENT: production
54+
run: |
55+
cd website
56+
hugo \
57+
--minify \
58+
--baseURL "${{ steps.pages.outputs.base_url }}/"
59+
- name: Upload artifact
60+
uses: actions/upload-pages-artifact@v3
61+
with:
62+
path: ./website/public
63+
64+
# Deployment job
65+
deploy:
66+
environment:
67+
name: github-pages
68+
url: ${{ steps.deployment.outputs.page_url }}
69+
runs-on: ubuntu-latest
70+
needs: build
71+
steps:
72+
- name: Deploy to GitHub Pages
73+
id: deployment
74+
uses: actions/deploy-pages@v4

website/hugo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
baseURL: 'https://example.org/'
1+
baseURL: 'https://cloudstreet-dev.github.io/The-Io-Programming-Language/'
22
languageCode: 'en-us'
33
title: 'The Io Programming Language'
44
theme: 'hugo-book'

0 commit comments

Comments
 (0)