-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (59 loc) · 1.87 KB
/
Copy pathpages-deploy.yml
File metadata and controls
72 lines (59 loc) · 1.87 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
63
64
65
66
67
68
69
70
71
72
# Build Hugo and publish the production site to the gh-pages branch.
name: pages-deploy
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
concurrency:
group: pages-deploy
cancel-in-progress: false
defaults:
run:
shell: bash
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive
fetch-depth: 0
- name: Read Hugo version
run: |
HUGO_VERSION="$(tr -d '[:space:]' < .hugo-version)"
if [[ ! "$HUGO_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::Invalid Hugo version in .hugo-version: $HUGO_VERSION"
exit 1
fi
echo "HUGO_VERSION=$HUGO_VERSION" >> "$GITHUB_ENV"
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb"
sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Verify Hugo Version
run: hugo version
- name: Enforce Hugo minimum version
run: python3 scripts/check-hugo-version.py
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo --gc --minify --baseURL "https://isaaclins.com/"
- name: Publish production site
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ github.token }}
branch: gh-pages
folder: ./public
clean-exclude: pr-preview/
single-commit: false
force: false