Skip to content

Commit ac0d8e9

Browse files
authored
Update hugo.yml
1 parent 6176456 commit ac0d8e9

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

.github/workflows/hugo.yml

+37-36
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,58 @@ on:
66
push:
77
branches: ["main"]
88

9-
# Allows you to run this workflow manually from the Actions tab
10-
workflow_dispatch:
11-
129
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1310
permissions:
1411
contents: read
1512
pages: write
1613
id-token: write
1714

18-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20-
concurrency:
21-
group: "pages"
22-
cancel-in-progress: false
23-
24-
# Default to bash
25-
defaults:
26-
run:
27-
shell: bash
15+
# Environment variables available to all jobs and steps in this workflow
16+
env:
17+
HUGO_ENV: production
18+
HUGO_VERSION: "0.139.2"
19+
GO_VERSION: "1.23.3"
20+
NODE_VERSION: "20.0.0"
21+
TINA_CLIENT_ID: ${{ vars.TINA_CLIENT_ID }}
22+
TINA_TOKEN: ${{ vars.TINA_TOKEN }}
2823

2924
jobs:
3025
# Build job
3126
build:
3227
runs-on: ubuntu-latest
33-
env:
34-
HUGO_VERSION: 0.139.2
3528
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 Node.js and PostCSS
41-
uses: actions/setup-node@v3
29+
- uses: actions/checkout@v4
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v4
4232
with:
43-
node-version: 16
44-
- name: Install Dependencies
33+
node-version: ${{ env.NODE_VERSION }}
34+
35+
- name: Install Hugo
4536
run: |
46-
npm install
47-
- name: Checkout Repository
48-
uses: actions/checkout@v4
49-
with:
50-
submodules: recursive
51-
- name: Build with Hugo
52-
env:
53-
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
54-
HUGO_ENVIRONMENT: production
37+
curl -LO "https://github.com/gohugoio/hugo/releases/download/v${{ env.HUGO_VERSION }}/hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz"
38+
tar -xvf hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz
39+
sudo mv hugo /usr/local/bin/
40+
rm hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz
41+
hugo version
42+
43+
- name: Install Go
5544
run: |
56-
hugo \
57-
--minify \
58-
--baseURL "${{ steps.pages.outputs.base_url }}/"
59-
- name: Upload Artifact
45+
curl -LO "https://dl.google.com/go/go${{ env.GO_VERSION }}.linux-amd64.tar.gz"
46+
sudo tar -C /usr/local -xzf go${{ env.GO_VERSION }}.linux-amd64.tar.gz
47+
echo "export PATH=$PATH:/usr/local/go/bin" >> $GITHUB_ENV
48+
rm go${{ env.GO_VERSION }}.linux-amd64.tar.gz
49+
go version
50+
51+
- name: Setup Project
52+
run: npm run project-setup
53+
54+
- name: Install npm dependencies
55+
run: npm install
56+
57+
- name: Publish to GitHub Pages
58+
run: npm run build
59+
60+
- name: Upload artifact
6061
uses: actions/upload-pages-artifact@v3
6162
with:
6263
path: ./public

0 commit comments

Comments
 (0)