Skip to content

Commit 39db1ef

Browse files
committed
Add Some Config & Deployment Workflow
1 parent 19d2e34 commit 39db1ef

File tree

3 files changed

+180
-0
lines changed

3 files changed

+180
-0
lines changed

.github/workflows/hugo.yaml

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

hugo.toml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,87 @@ baseURL = 'https://www.codelust.dev/'
22
languageCode = 'en-GB'
33
title = 'CodeLust'
44
theme = "hugo-theme-m10c"
5+
6+
[pagination]
7+
pagerSize = 8
8+
9+
[menu]
10+
[[menu.main]]
11+
identifier = "home"
12+
name = "Home"
13+
url = "/"
14+
weight = 1
15+
[[menu.main]]
16+
identifier = "tags"
17+
name = "Tags"
18+
url = "/tags/"
19+
weight = 2
20+
[[menu.main]]
21+
identifier = "about"
22+
name = "About"
23+
url = "/about/"
24+
weight = 3
25+
26+
[params]
27+
author = "John Doe"
28+
description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
29+
menu_item_separator = " - "
30+
[[params.social]]
31+
icon = "brand-github"
32+
name = "Github"
33+
url = "https://github.com/gohugoio"
34+
[[params.social]]
35+
icon = "brand-x"
36+
name = "X"
37+
url = "https://twitter.com/gohugoio"
38+
[[params.social]]
39+
icon = "brand-mastodon"
40+
name = "Twitter"
41+
url = "https://twitter.com/gohugoio"
42+
43+
# Default theme
44+
# [params.style]
45+
# darkestColor = "#242930"
46+
# darkColor = "#353b43"
47+
# lightColor = "#afbac4"
48+
# lightestColor = "#ffffff"
49+
# primaryColor = "#57cc8a"
50+
51+
# Green theme
52+
# [params.style]
53+
# darkestColor = "#315659"
54+
# darkColor = "#253031"
55+
# lightColor = "#96a879"
56+
# lightestColor = "#fff"
57+
# primaryColor = "#dad865"
58+
59+
# Red theme
60+
# [params.style]
61+
# darkestColor = "#d35050"
62+
# darkColor = "#212121"
63+
# lightColor = "#d6d6d6"
64+
# lightestColor = "#d3d3d3"
65+
# primaryColor = "#ffffff"
66+
67+
[caches]
68+
[caches.assets]
69+
dir = ':cacheDir/assets'
70+
maxAge = -1
71+
[caches.getcsv]
72+
dir = ':cacheDir/:project'
73+
maxAge = -1
74+
[caches.getjson]
75+
dir = ':cacheDir/:project'
76+
maxAge = -1
77+
[caches.getresource]
78+
dir = ':cacheDir/:project'
79+
maxAge = -1
80+
[caches.images]
81+
dir = ':cacheDir/images'
82+
maxAge = -1
83+
[caches.misc]
84+
dir = ':cacheDir/:project'
85+
maxAge = -1
86+
[caches.modules]
87+
dir = ':cacheDir/modules'
88+
maxAge = -1

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ title = 'My New Post'
1212
date = 2025-05-18T23:02:01+01:00
1313
draft = true
1414
+++
15+
1516
## Introduction
1617

1718
This is **bold** text, and this is *emphasized* text.

0 commit comments

Comments
 (0)