This is an example repo using the version-docs github action
Within this example repository we are using typedoc, however there are many other tools that might fit your needs better. Some of the other popular ones include:
name: Version Docs
on: push
jobs:
CI:
runs-on: ubuntu-latest
env:
CI: true # this is needed to ignore husky hooks
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 13.5
- name: Install dependencies
run: yarn install
- name: Generate docs
run: yarn docs # or your repo-specific command to generate documentation in a folder named 'docs' at the root of your repo
- name: Version docs
uses: bobrown101/version-docs@v2.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
doc-location: docs
doc-branch: gh-pages
sh: 1: cannot open /dev/tty: No such device or address
This will occur if you use a tool like husky to install git hooks, and commitizen to help create conventional commit messages. These are helpful for local development, but on CI servers they sometimes get in the way. In our case it prevents version-docs from committing your docs to the docs-branch. The solution? Set the enviornment variable CI for your jobs
name: Version Docs
on: push
jobs:
CI:
runs-on: ubuntu-latest
env:
CI: true # this is needed to ignore husky hooks
Husky will check for the enviornment variable CI, and if present it will skip installing git hooks
Generated using TypeDoc