diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 776cdbd..eea3e53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ name: Build and Deploy to Netlify on: push: branches: - - main + - cason/docs-symlink workflow_dispatch: schedule: - cron: "0 0 * * *" @@ -36,6 +36,9 @@ jobs: run: | chmod a+wx . bundle exec jekyll build --disable-disk-cache -V + # Create _pages/version/docs link + - name: Add symbolic links + run: make symlinks # Deploy the _site folder to Netlify CometBFT documentation website - name: Deploy to Netlify uses: nwtgck/actions-netlify@v2.0.0 diff --git a/Makefile b/Makefile index b6439af..717d833 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,15 @@ build: @rm -rf _site/build .PHONY: build +symlinks: + @if [ ! -d "_pages" ]; then echo "Directory _pages does not exist. Please run \"make fetch\" before running this command"; exit 1; fi + @while read -r branch output_path visible ; do \ + [ -L _site/$${output_path}/docs ] || ln -vs . _site/$${output_path}/docs ; \ + done < VERSIONS + @if [ "${LOCAL_DOCS_REPO}" ]; then \ + [ -L_site/dev/docs ] || ln -vs . _site/dev/docs ; \ + fi + # Creates _data/versions.yml, which is built from the VERSIONS file, in order # to provide information about versions to Jekyll during the site build # process. This assists in constructing the dropdown version selector menu.