Skip to content

Commit 68fbfcb

Browse files
Publish Hugo site to GitHub Pages on main
Set baseURL to https://ardurai.github.io/mara/, add deploy job with upload-pages-artifact and deploy-pages, and document one-time Pages source setup in website/README. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 90793ea commit 68fbfcb

4 files changed

Lines changed: 39 additions & 7 deletions

File tree

.github/workflows/hugo.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Build Mara static site (Hugo) — upload public/ as Pages artifact
1+
# Build Mara static site (Hugo) — publish to GitHub Pages on main (optional artifact on all builds).
22
name: hugo
33

44
on:
@@ -13,6 +13,15 @@ on:
1313
- '.github/workflows/hugo.yml'
1414
workflow_dispatch:
1515

16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-github-pages
23+
cancel-in-progress: false
24+
1625
defaults:
1726
run:
1827
working-directory: website
@@ -32,8 +41,25 @@ jobs:
3241
- name: Build
3342
run: hugo --gc --minify
3443

35-
- name: Upload site
44+
- name: Upload site (artifact)
3645
uses: actions/upload-artifact@v4
3746
with:
3847
name: mara-site
3948
path: website/public
49+
50+
- name: Upload Pages artifact
51+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: website/public
55+
56+
deploy:
57+
needs: build
58+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
59+
runs-on: ubuntu-latest
60+
environment:
61+
name: github-pages
62+
url: ${{ steps.deployment.outputs.page_url }}
63+
steps:
64+
- id: deployment
65+
uses: actions/deploy-pages@v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ A **Hugo** static site (home, docs hub, community, quickstart) lives in [`websit
9292
cd website && hugo server -D
9393
```
9494

95-
See [`website/README.md`](website/README.md) for theme notes, production build, and CI. Set `baseURL` in `website/hugo.toml` before deploying.
95+
See [`website/README.md`](website/README.md) for theme notes, production build, and CI. The Hugo site defaults to **GitHub Pages** (`https://ardurai.github.io/mara/`); adjust `website/hugo.toml` if you use another host.
9696

9797
## Install and verify
9898

website/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ hugo --gc --minify
3131

3232
## Configuration
3333

34-
- [`hugo.toml`](hugo.toml)set `baseURL` to your real domain before deploying (placeholder is `https://example.com/`).
34+
- [`hugo.toml`](hugo.toml)`baseURL` defaults to the GitHub Pages project URL (`https://ardurai.github.io/mara/`). Update it if you move hosting or attach a custom domain.
3535

3636
## Deploy
3737

38-
CI can build with [peaceiris/actions-hugo](https://github.com/peaceiris/actions-hugo) (see `.github/workflows/hugo.yml`). Upload `website/public/` as a GitHub Pages artifact or sync to any static host.
38+
CI builds with [peaceiris/actions-hugo](https://github.com/peaceiris/actions-hugo) and, on pushes to **`main`** (not PRs), publishes to **GitHub Pages** via `.github/workflows/hugo.yml`.
39+
40+
**One-time repo setup:** Settings → Pages → Build and deployment → Source: **GitHub Actions**.
41+
42+
After a successful deploy from `main`, the site is at **https://ardurai.github.io/mara/**.
43+
44+
You can still run `hugo --gc --minify` locally and sync `website/public/` elsewhere if needed.

website/hugo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Mara project site — https://gohugo.io/
2-
# Replace baseURL when deploying (GitHub Pages, Netlify, etc.).
3-
baseURL = 'https://example.com/'
2+
# Default public URL: GitHub Pages (project site). Change when you add a custom domain.
3+
baseURL = 'https://ardurai.github.io/mara/'
44
# Hugo 0.158+ prefers `locale` over deprecated `languageCode`.
55
locale = 'en-US'
66
title = 'Mara'

0 commit comments

Comments
 (0)