-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.55 KB
/
Copy pathgh-pages.yml
File metadata and controls
62 lines (53 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: GitHub Pages
on:
push:
branches:
- master
workflow_dispatch:
concurrency:
group: "pages"
cancel-in-progress: true # Changed to true: cancels old builds if you push 2x quickly
defaults:
run:
shell: bash
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4 # Updated to v4
with:
submodules: recursive # 'recursive' is safer for themes
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: "0.154.5" # IMPORTANT: Match your Dev Container version
extended: true
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4 # Updated to v4
# Optional: This speeds up builds by caching Hugo modules
- name: Cache Hugo modules
uses: actions/cache@v4
with:
path: /tmp/hugo_cache
key: ${{ runner.os }}-hugo-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugo-
- name: Build
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Deploy
uses: peaceiris/actions-gh-pages@v3 # This one is still v3 (stable)
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./public