Skip to content

Commit 9fa2099

Browse files
committed
fix pnpm version conflict in reusable hugo workflow
1 parent aee3dca commit 9fa2099

1 file changed

Lines changed: 95 additions & 95 deletions

File tree

Lines changed: 95 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,95 @@
1-
name: Reusable Hugo Deployment Workflow
2-
3-
on:
4-
workflow_call:
5-
inputs:
6-
hugo_version:
7-
type: string
8-
default: '0.143.0'
9-
required: false
10-
base_url:
11-
type: string
12-
default: 'https://d-oit.github.io'
13-
required: false
14-
15-
jobs:
16-
build:
17-
runs-on: ubuntu-latest
18-
env:
19-
HUGO_VERSION: ${{ inputs.hugo_version }}
20-
steps:
21-
- name: Check out repository
22-
uses: actions/checkout@v4
23-
with:
24-
submodules: recursive
25-
fetch-depth: 0
26-
27-
- name: Install pnpm
28-
uses: pnpm/action-setup@v4
29-
with:
30-
version: pnpm
31-
32-
- name: Set up Node.js
33-
uses: actions/setup-node@v4
34-
with:
35-
node-version: lts/*
36-
cache: 'pnpm'
37-
cache-dependency-path: 'pnpm-lock.yaml'
38-
39-
- name: Install dependencies
40-
run: pnpm install
41-
42-
- name: Lint the source files
43-
run: pnpm run lint
44-
45-
- name: Install Hugo CLI
46-
run: |
47-
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
48-
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
49-
50-
- name: Install Dart Sass
51-
run: sudo snap install dart-sass
52-
53-
- name: Install Node.js dependencies
54-
run: "[[ -f pnpm-lock.yaml ]] && pnpm install --frozen-lockfile || true"
55-
56-
- name: Build with Hugo
57-
env:
58-
HUGO_ENVIRONMENT: production
59-
HUGO_ENV: production
60-
TZ: America/Los_Angeles
61-
run: |
62-
hugo --gc --minify --baseURL "${{ inputs.base_url }}" && cd public/en && cp 404.html ../404.html
63-
64-
- name: Upload artifact
65-
uses: actions/upload-pages-artifact@v3
66-
with:
67-
path: ./public
68-
69-
deploy:
70-
environment:
71-
name: github-pages
72-
url: ${{ steps.deployment.outputs.page_url }}
73-
runs-on: ubuntu-latest
74-
needs: build
75-
steps:
76-
- name: Deploy to GitHub Pages
77-
id: deployment
78-
uses: actions/deploy-pages@v4
79-
80-
lighthouse:
81-
runs-on: ubuntu-latest
82-
needs: deploy
83-
steps:
84-
- uses: actions/checkout@v4
85-
- name: Audit URLs using Lighthouse
86-
uses: treosh/lighthouse-ci-action@v12
87-
with:
88-
urls: |
89-
${{ inputs.base_url }}/en/
90-
${{ inputs.base_url }}/en/blog/
91-
${{ inputs.base_url }}/de/
92-
${{ inputs.base_url }}/de/blog/
93-
${{ inputs.base_url }}/en/projects/
94-
uploadArtifacts: true
95-
temporaryPublicStorage: true
1+
name: Reusable Hugo Deployment Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
hugo_version:
7+
type: string
8+
default: '0.143.0'
9+
required: false
10+
base_url:
11+
type: string
12+
default: 'https://d-oit.github.io'
13+
required: false
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
env:
19+
HUGO_VERSION: ${{ inputs.hugo_version }}
20+
steps:
21+
- name: Check out repository
22+
uses: actions/checkout@v4
23+
with:
24+
submodules: recursive
25+
fetch-depth: 0
26+
27+
- name: Install pnpm
28+
uses: pnpm/action-setup@v4
29+
with:
30+
version: '10.17.1'
31+
32+
- name: Set up Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: lts/*
36+
cache: 'pnpm'
37+
cache-dependency-path: 'pnpm-lock.yaml'
38+
39+
- name: Install dependencies
40+
run: pnpm install
41+
42+
- name: Lint the source files
43+
run: pnpm run lint
44+
45+
- name: Install Hugo CLI
46+
run: |
47+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
48+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
49+
50+
- name: Install Dart Sass
51+
run: sudo snap install dart-sass
52+
53+
- name: Install Node.js dependencies
54+
run: "[[ -f pnpm-lock.yaml ]] && pnpm install --frozen-lockfile || true"
55+
56+
- name: Build with Hugo
57+
env:
58+
HUGO_ENVIRONMENT: production
59+
HUGO_ENV: production
60+
TZ: America/Los_Angeles
61+
run: |
62+
hugo --gc --minify --baseURL "${{ inputs.base_url }}" && cd public/en && cp 404.html ../404.html
63+
64+
- name: Upload artifact
65+
uses: actions/upload-pages-artifact@v3
66+
with:
67+
path: ./public
68+
69+
deploy:
70+
environment:
71+
name: github-pages
72+
url: ${{ steps.deployment.outputs.page_url }}
73+
runs-on: ubuntu-latest
74+
needs: build
75+
steps:
76+
- name: Deploy to GitHub Pages
77+
id: deployment
78+
uses: actions/deploy-pages@v4
79+
80+
lighthouse:
81+
runs-on: ubuntu-latest
82+
needs: deploy
83+
steps:
84+
- uses: actions/checkout@v4
85+
- name: Audit URLs using Lighthouse
86+
uses: treosh/lighthouse-ci-action@v12
87+
with:
88+
urls: |
89+
${{ inputs.base_url }}/en/
90+
${{ inputs.base_url }}/en/blog/
91+
${{ inputs.base_url }}/de/
92+
${{ inputs.base_url }}/de/blog/
93+
${{ inputs.base_url }}/en/projects/
94+
uploadArtifacts: true
95+
temporaryPublicStorage: true

0 commit comments

Comments
 (0)