Files
firezone/.github/workflows/publish_docs.yml
Jamil 44c462e957 Fix docs publishing workflow (#627)
* Fix table overflow

* Fix docs publishing
2022-05-18 12:12:25 -07:00

54 lines
1.8 KiB
YAML

name: Publish Docs
on:
release:
types: [published]
jobs:
publish-docs:
runs-on: macos-11
steps:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Write tags manifest
run: |
echo ${{ steps.get_version.outputs.VERSION }} > docs/assets/versions.txt
tags=`git ls-tree --name-only origin/gh-pages | egrep "^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$"`
echo $tags | tr " " "\n" | sort -Vr >> docs/assets/versions.txt
- name: Build jekyll site
run: |
cd docs/
gem install bundler
bundle install
# Generate top-level docs
bundle exec jekyll build \
--destination _latest
# Generate versioned docs
bundle exec jekyll build \
--baseurl ${{ steps.get_version.outputs.VERSION }} \
--destination ${{ steps.get_version.outputs.VERSION }}
- name: Publish Latest Docs
uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
branch: gh-pages
folder: docs/_latest
target-folder: .
clean: true
clean-exclude: |
*.*.*/
- name: Publish Versioned Docs
uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
branch: gh-pages
folder: docs/${{ steps.get_version.outputs.VERSION }}
target-folder: ${{ steps.get_version.outputs.VERSION }}
clean: true