From 9bc2c96f34c4b051aa3d117a7a8d794901fe0fba Mon Sep 17 00:00:00 2001 From: Andy Nogueira Date: Tue, 12 Dec 2023 15:09:49 -0500 Subject: [PATCH] Fix staging deployment (#88) * Github action to deploy to Staging (#82) * added logic to fetch the staging-docs branch and use as default (#86) * modified Github action and Makefile to include staging site (#82) --- .github/workflows/staging.yml | 2 +- Makefile | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index e356641..033c20d 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v3 # Clone the cometbft repo - name: Fetch cometbft repo - run: make fetch + run: make STAGING_DOCS=true fetch # Generate _data folder content - name: Build versions data run: make STAGING_DOCS=true versions-data diff --git a/Makefile b/Makefile index 0e04558..cae40f8 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,20 @@ fetch: clean versions-data rm -rf _pages/dev/architecture _pages/dev/rfc ; \ echo ""; \ fi + @if [ "${STAGING_DOCS}" ]; then \ + echo "-----> Checking out staging-docs" ; \ + cd build/cometbft ; \ + git checkout staging-docs ; \ + cd ../.. ; \ + mkdir -pv _pages/staging/spec ; \ + mkdir -pv _pages/staging/rpc ; \ + cp -r build/cometbft/docs/* _pages/staging ; \ + cp -r build/cometbft/spec/* _pages/staging/spec ; \ + cp -r build/cometbft/rpc/openapi/* _pages/staging/rpc ; \ + find _pages/staging -type f -iname README.md | xargs -I % sh -c 'mv -v % $$(dirname %)/index.md' ; \ + rm -rf _pages/staging/architecture _pages/staging/rfc ; \ + echo "" ; \ + fi .PHONY: fetch # This builds the documentation site for cometbft (docs.cometbft.com) @@ -75,7 +89,6 @@ versions-data: echo " output_path: staging" >> _data/versions.yml; \ echo " visible: true" >> _data/versions.yml; \ echo "output_path: staging" > _data/default_version.yml ; \ - echo "staging-docs staging true" >> VERSIONS ; \ fi .PHONY: versions-data