From 383b49fdc898ff637c2a01f886fed4b0989ea743 Mon Sep 17 00:00:00 2001 From: Will Hickey Date: Wed, 11 Sep 2024 10:27:15 -0500 Subject: [PATCH] Publish Agave docs (#2887) * Add publish-docs.sh to build.sh * Add debugging echos * Fake being in CI * Update vercel doc project names * Remove debugging echos. Remove CI var. --- docs/build.sh | 11 +++++++++++ docs/publish-docs.sh | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/build.sh b/docs/build.sh index 4a122678a19b09..cc84d82c68bf05 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -15,3 +15,14 @@ source ../ci/rust-version.sh # Build from /src into /build npm run build echo $? + +# Publish only from merge commits and beta release tags +if [[ -n $CI ]]; then + if [[ -z $CI_PULL_REQUEST ]]; then + if [[ -n $CI_TAG ]] && [[ $CI_TAG != $BETA_CHANNEL* ]]; then + echo "not a beta tag" + exit 0 + fi + ./publish-docs.sh + fi +fi diff --git a/docs/publish-docs.sh b/docs/publish-docs.sh index 0cbedcf882001d..c14e9bc9dc3dea 100755 --- a/docs/publish-docs.sh +++ b/docs/publish-docs.sh @@ -9,15 +9,15 @@ fi CONFIG_FILE=vercel.json if [[ -n $CI_TAG ]]; then - PROJECT_NAME=docs-solana-com + PROJECT_NAME=docs-anza-xyz else eval "$(../ci/channel-info.sh)" case $CHANNEL in edge) - PROJECT_NAME=edge-docs-solana-com + PROJECT_NAME=edge-docs-anza-xyz ;; beta) - PROJECT_NAME=beta-docs-solana-com + PROJECT_NAME=beta-docs-anza-xyz ;; *) PROJECT_NAME=docs @@ -151,4 +151,4 @@ EOF echo "VERCEL_TOKEN is undefined. Needed for Vercel authentication." exit 1 } -vercel deploy . --local-config="$CONFIG_FILE" --confirm --token "$VERCEL_TOKEN" --prod +vercel deploy . --local-config="$CONFIG_FILE" --yes --token "$VERCEL_TOKEN" --prod