Skip to content

Commit 608fab7

Browse files
Abhigyan Prakashclaude
andcommitted
Add GitHub Actions workflow for GitHub Pages deployment
- Add deploy.yml workflow to build and deploy on push to main - Update baseURL for GitHub Pages - Add deployment instructions to README Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fe7ed47 commit 608fab7

3 files changed

Lines changed: 64 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy Hugo site 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+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
submodules: recursive
25+
fetch-depth: 0
26+
27+
- name: Setup Hugo
28+
uses: peaceiris/actions-hugo@v3
29+
with:
30+
hugo-version: 'latest'
31+
extended: true
32+
33+
- name: Build
34+
run: hugo --minify
35+
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: ./public
40+
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
runs-on: ubuntu-latest
46+
needs: build
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,19 @@ hugo
140140
hugo --minify
141141
```
142142

143+
## Deployment
144+
145+
The site automatically deploys to GitHub Pages when you push to `main`.
146+
147+
### Setup (one-time)
148+
149+
1. Go to your GitHub repo **Settings****Pages**
150+
2. Under **Build and deployment**, set Source to **GitHub Actions**
151+
152+
### Manual deployment
153+
154+
Push to `main` branch or manually trigger the workflow from the **Actions** tab.
155+
143156
## Resources
144157

145158
- [Hugo Documentation](https://gohugo.io/documentation/)

hugo.toml

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://abgnpr.github.io/learning/'
22
languageCode = 'en-us'
33
title = 'Learning'
44
theme = 'hugo-PaperMod'

0 commit comments

Comments
 (0)