Skip to content

Commit

Permalink
Fix staging deployment (#88)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
andynog authored Dec 12, 2023
1 parent ff25bd8 commit 9bc2c96
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 9bc2c96

Please sign in to comment.