Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
User vercel to publish, add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
publish-docs.sh committed Jul 8, 2020
1 parent 40b4a8c commit db76f57
Showing 4 changed files with 41 additions and 2 deletions.
1 change: 0 additions & 1 deletion docs/Procfile

This file was deleted.

37 changes: 37 additions & 0 deletions docs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -ex

cd "$(dirname "$0")"

# md check
find src -name '*.md' -a \! -name SUMMARY.md |
while read -r file; do
if ! grep -q '('"${file#src/}"')' src/SUMMARY.md; then
echo "Error: $file missing from SUMMARY.md"
exit 1
fi
done

# auto-generate src/cli/usage.md
./build-cli-usage.sh

./set-solana-release-tag.sh

# Build from /src into /build
npm run build


# Deploy the /build content using vercel

npm i -g vercel

if [[ -d .vercel ]]; then
rm -r .vercel
fi

PROD=
if [[ -n $PRODUCTION ]]; then
PROD="--prod"
fi

vercel deploy . --local-config=vercel.json --confirm $PROD
1 change: 0 additions & 1 deletion docs/set-solana-release-tag.sh
Original file line number Diff line number Diff line change
@@ -23,7 +23,6 @@ if [[ -z "$LATEST_SOLANA_RELEASE_VERSION" ]]; then
fi

set -x
find html/ -name \*.html -exec sed -i "s/LATEST_SOLANA_RELEASE_VERSION/$LATEST_SOLANA_RELEASE_VERSION/g" {} \;
if [[ -n $CI ]]; then
find src/ -name \*.md -exec sed -i "s/LATEST_SOLANA_RELEASE_VERSION/$LATEST_SOLANA_RELEASE_VERSION/g" {} \;
fi
4 changes: 4 additions & 0 deletions docs/vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "edge-docs-solana-com",
"scope": "solana-labs"
}

0 comments on commit db76f57

Please sign in to comment.