Skip to content

Commit 905d34e

Browse files
committed
fix: update htmltest sanity check for new deploy
1 parent 4f6c704 commit 905d34e

4 files changed

Lines changed: 20 additions & 28 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ jobs:
5454
run: |
5555
docker compose build --pull hugo
5656
docker compose run --rm --no-deps \
57+
--entrypoint sh \
5758
--user "$(id -u):$(id -g)" \
59+
-e HOME=/tmp \
60+
-e npm_config_cache=/tmp/.npm \
5861
-e HUGO_ENV=production \
5962
-e HUGO_CACHEDIR="${HUGO_CACHEDIR}" \
6063
-e BASE_URL="${BASE_URL}" \
61-
hugo sh -lc 'git config --global --add safe.directory /src && git config --global core.quotepath false && hugo build --gc --minify --baseURL "${BASE_URL%/}/" --cacheDir "${HUGO_CACHEDIR}"'
64+
hugo -lc 'git config --global --add safe.directory /src && git config --global core.quotepath false && hugo build --gc --minify --baseURL "${BASE_URL%/}/" --cacheDir "${HUGO_CACHEDIR}"'
6265
6366
- name: Save build cache
6467
if: always()

.github/workflows/run-htmltest.yml

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,39 @@ on:
44
branches: [ "develop" ]
55
pull_request:
66
branches: [ "develop" ]
7+
workflow_dispatch:
78

89
jobs:
910
htmltest:
1011
runs-on: ubuntu-latest
1112
steps:
1213
- uses: actions/checkout@v4
13-
14-
- name: Read .env hugo version
15-
id: hugo-version
16-
run: |
17-
. ./.env
18-
echo "::set-output name=HUGO_VERSION::${HUGO_VERSION}"
19-
echo "::set-output name=DOCSY_VERSION::${DOCSY_VERSION}"
20-
21-
- name: Add hugo nodejs dependencies
22-
uses: actions/setup-node@v4
2314
with:
24-
node-version: "18"
25-
cache: 'npm'
15+
fetch-depth: 0
2616

27-
- name: Setup Hugo
28-
uses: peaceiris/actions-hugo@v3
29-
with:
30-
# sync versions with docker-compose .env ala
31-
# https://github.com/marketplace/actions/hugo-setup#%EF%B8%8F-read-hugo-version-from-file
32-
hugo-version: "${{ steps.hugo-version.outputs.HUGO_VERSION }}"
33-
extended: true
34-
35-
- name: Build Hugo site
17+
- name: Build Hugo site in Docker Compose
3618
env:
3719
HUGO_ENV: "production"
3820
run: |
39-
npm install
40-
hugo --minify --gc -d $GITHUB_WORKSPACE/dist
21+
docker compose build --pull hugo
22+
docker compose run --rm --no-deps \
23+
--entrypoint sh \
24+
--user "$(id -u):$(id -g)" \
25+
-e HOME=/tmp \
26+
-e npm_config_cache=/tmp/.npm \
27+
-e HUGO_ENV="${HUGO_ENV}" \
28+
hugo -lc 'git config --global --add safe.directory /src && git config --global core.quotepath false && hugo build --gc --minify -d /src/dist'
29+
4130
- name: run htmltest
4231
continue-on-error: true
4332
uses: wjdp/htmltest-action@master
4433
with:
4534
config: .htmltest.yml
35+
4636
- name: archive htmltest results
37+
if: always()
4738
uses: actions/upload-artifact@v4
4839
with:
4940
name: htmltest-report
50-
path: tmp/.htmltest/htmltest.log
41+
path: tmp/.htmltest/
5142
retention-days: 5

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ USER root
1010
RUN git config --global --add safe.directory /src
1111

1212
# Install Node.js and npm for PostCSS (required by Docsy)
13-
RUN apk add --no-cache nodejs npm
13+
RUN apk add --no-cache nodejs npm go
1414

1515
# Install front-end tooling.
1616
# Layer is invalidated only when package.json or package-lock.json changes.

hugo.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ module:
4848
# mount ISSUE_TEMPLATE to content/issue_templates to re-use the templates in the site
4949
- source: "content/en"
5050
target: "content"
51-
lang: "en"
5251
- source: ".github/ISSUE_TEMPLATE"
5352
target: "content/issue_templates"
54-
lang: "en"
5553

5654
# Configure how URLs look like per section.
5755
permalinks:

0 commit comments

Comments
 (0)