Skip to content

Commit f39d2ac

Browse files
author
Charlie Egan
committed
website: Use latest release rather than edge
Signed-off-by: Charlie Egan <charlie@styra.com>
1 parent 5430c72 commit f39d2ac

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,11 @@ else
462462
release-ci: push-image push-manifest-list-latest
463463
endif
464464

465-
.PHONY: netlify
466-
netlify: docs-clean docs-ci docs-build
465+
.PHONY: netlify-latest
466+
netlify-latest: docs-clean docs-ci docs-build-latest
467+
468+
.PHONY: netlify-edge
469+
netlify-edge: docs-clean docs-ci docs-build
467470

468471
# Kept for compatibility. Use `make fuzz` instead.
469472
.PHONY: check-fuzz

docs/Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ dev:
1414
build:
1515
npx docusaurus build
1616

17+
.PHONY: build-latest
18+
build-latest:
19+
@if ! git diff --quiet HEAD -- || ! git diff --cached --quiet; then \
20+
echo "Latest release build must be done without working changes"; \
21+
git status; \
22+
exit 1; \
23+
fi
24+
git fetch --tags origin
25+
$(eval CURRENT_REF := $(shell git rev-parse HEAD))
26+
LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1) && \
27+
[ -n "$LATEST_TAG" ] || (echo "No valid release tag found (expected format: v1.2.3)" && exit 1) && \
28+
git checkout $LATEST_TAG && \
29+
BUILD_VERSION=$LATEST_TAG npx docusaurus build && \
30+
git checkout $(CURRENT_REF)
31+
1732
.PHONY: clean
1833
clean:
1934
rm -rf build .docusaurus

netlify.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build]
22
publish = "docs/build"
3-
command = "make netlify"
3+
command = "make netlify-latest"
44
edge_functions = "docs/functions"
55

66
[build.environment]
@@ -9,6 +9,9 @@ NODE_VERSION = "22.15.0"
99
# secret scan
1010
SECRETS_SCAN_OMIT_PATHS = "v1/test/cases,v1/topdown/crypto_test.go"
1111

12+
[context.deploy-preview]
13+
command = "make netlify-latest"
14+
1215
[[edge_functions]]
1316
# this path should not be changed as various external sites depend on it for OPA
1417
# badges.

0 commit comments

Comments
 (0)