Skip to content

Commit

Permalink
Manual execution for staging docs (#90)
Browse files Browse the repository at this point in the history
* Manual execution for staging docs

* Makefile fix
  • Loading branch information
greg-szabo authored Feb 15, 2024
1 parent 9bc2c96 commit d343fee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: Build and Deploy to Netlify Staging
# This workflow runs manually to deploy the
# CometBFT documentation staging website to Netlify
on:
push:
branches:
- main
workflow_dispatch:
inputs:
branch:
description: 'CometBFT branch with documentation'
required: false
default: 'staging-docs'
type: string
jobs:
build:
name: Build and deploy to Netlify (Staging)
Expand All @@ -20,10 +24,10 @@ jobs:
uses: actions/checkout@v3
# Clone the cometbft repo
- name: Fetch cometbft repo
run: make STAGING_DOCS=true fetch
run: make STAGING_DOCS=true STAGING_BRANCH=${{ inputs.branch }} fetch
# Generate _data folder content
- name: Build versions data
run: make STAGING_DOCS=true versions-data
run: make STAGING_DOCS=true STAGING_BRANCH=${{ inputs.branch }} versions-data
# Install Jekyll dependencies
- name: Install dependencies
run: |
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
### Documentation ###
###############################################################################

# When deploying to the staging server, deploy from this branch.
STAGING_BRANCH?=staging-docs

# Clone repository branches and copy docs and spec folders into our _pages
# collection.
fetch: clean versions-data
Expand Down Expand Up @@ -36,9 +39,9 @@ fetch: clean versions-data
echo ""; \
fi
@if [ "${STAGING_DOCS}" ]; then \
echo "-----> Checking out staging-docs" ; \
echo "-----> Checking out ${STAGING_BRANCH}" ; \
cd build/cometbft ; \
git checkout staging-docs ; \
git checkout "${STAGING_BRANCH}" ; \
cd ../.. ; \
mkdir -pv _pages/staging/spec ; \
mkdir -pv _pages/staging/rpc ; \
Expand Down Expand Up @@ -85,7 +88,7 @@ versions-data:
fi
@if [ "${STAGING_DOCS}" ]; then \
echo "Adding \"staging\" version"; \
echo "- branch: staging-docs" >> _data/versions.yml; \
echo "- branch: ${STAGING_BRANCH}" >> _data/versions.yml; \
echo " output_path: staging" >> _data/versions.yml; \
echo " visible: true" >> _data/versions.yml; \
echo "output_path: staging" > _data/default_version.yml ; \
Expand Down

0 comments on commit d343fee

Please sign in to comment.