mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-24 09:15:31 -06:00
1b7e7de85a
Only revert the docs content to the latest release. Retain all other parts of the site the same. Signed-off-by: Charlie Egan <charlie_egan@apple.com>
24 lines
565 B
Bash
Executable File
24 lines
565 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
if ! git diff --quiet HEAD -- || ! git diff --cached --quiet; then
|
|
echo "Latest release build must be done without working changes"
|
|
git status
|
|
exit 1
|
|
fi
|
|
|
|
git fetch --tags origin
|
|
|
|
LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1)
|
|
|
|
if [ -z "$LATEST_TAG" ]; then
|
|
echo "No valid release tag found (expected format: v1.2.3)"
|
|
exit 1
|
|
fi
|
|
|
|
# for docs content we use the latest release
|
|
git checkout "$LATEST_TAG" -- docs
|
|
|
|
BUILD_VERSION="$LATEST_TAG" npx docusaurus build
|