Skip to content

Commit 6ccf360

Browse files
committed
update action and provide example
1 parent 546eac1 commit 6ccf360

File tree

3 files changed

+102
-7
lines changed

3 files changed

+102
-7
lines changed

.github/workflows/hugo.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
# Sample workflow for building and deploying a Hugo site to GitHub Pages
21
name: Deploy Hugo site to Pages
32

43
on:
5-
# Runs on pushes targeting the default branch
64
push:
75
branches:
86
- main
97

10-
# Allows you to run this workflow manually from the Actions tab
118
workflow_dispatch:
129

1310
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
@@ -34,7 +31,7 @@ jobs:
3431
env:
3532
HUGO_VERSION: 0.151.0
3633
HUGO_ENVIRONMENT: production
37-
TZ: America/Los_Angeles
34+
TZ: America/New_York
3835
steps:
3936
- name: Install Hugo CLI
4037
run: |
@@ -64,14 +61,15 @@ jobs:
6461
- name: Configure Git
6562
run: git config core.quotepath false
6663
- name: Build with Hugo
64+
env:
65+
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
6766
run: |
6867
cd exampleSite && \
6968
hugo \
7069
--gc \
7170
--minify \
7271
--themesDir ../.. \
73-
--baseURL "${{ steps.pages.outputs.base_url }}/" \
74-
--cacheDir "${{ runner.temp }}/hugo_cache"
72+
--baseURL "${{ steps.pages.outputs.base_url }}/"
7573
- name: Cache Save
7674
id: cache-save
7775
uses: actions/cache/save@v4
@@ -94,4 +92,4 @@ jobs:
9492
steps:
9593
- name: Deploy to GitHub Pages
9694
id: deployment
97-
uses: actions/deploy-pages@v4
95+
uses: actions/deploy-pages@v4

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ git submodule add https://github.com/nbovee/bot-ready-resume.git themes/bot-read
4141
mkdir -p data
4242
cp themes/bot-ready-resume/exampleSite/hugo.yml .
4343
cp themes/bot-ready-resume/exampleSite/data/data.yml data/
44+
mkdir -p .github/workflows
45+
cp themes/bot-ready-resume/example_github_action.yml .github/workflows/hugo.yml
4446

4547
# Start development server
4648
hugo server
@@ -51,6 +53,8 @@ Your will also have `llms.txt` at `http://localhost:1313/llms.txt`, and a markdo
5153

5254
Edit `data/data.yml` to customize your resume content.
5355

56+
You may need to configure your repository to deploy from Github Actions, once enabled pushes to main will deploy the latest version of your resume.
57+
5458
### Customization
5559

5660
#### Essential Files

example_github_action.yml

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

0 commit comments

Comments
 (0)