DEV Community

Brady Brown
Brady Brown

Posted on

Automatically version and deploy your documentation with github actions

Hey guys,

I created two github actions that allow you to automatically version and deploy your documentation.

You get the simplicity of keeping your documentation versioned in git, without the annoyance of having huge PR's due to auto-generated-doc updates.

Right now the only hosting provider implemented is netlfiy, however more are planned.

https://github.com/bobrown101/version-docs

https://github.com/bobrown101/deploy-branch

Here is an example of how you would use it within your github repo:

name: Version and Deploy docs
on: push
jobs:
  CI:
    runs-on: ubuntu-latest
    env:
      CI: true
    steps:
    - name: Generate docs
      run: yarn docs
    - name: Version docs
      uses: bobrown101/version-docs@v2.1.0
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        doc-location: docs
        doc-branch: docs
    - name: Deploy docs
      uses: bobrown101/deploy-branch@v2.0.0
      with:
        provider: NETLIFY
        netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
        netlify-site-id: <<siteid>>
        branch: docs
        github-token: ${{ secrets.GITHUB_TOKEN }}

I would appreciate any feedback and stars on github.

Thanks,

Brady

Top comments (1)

Collapse
 
bobrown101 profile image
Brady Brown

Here is an example of the generated docs hosted on netlify:
ge-fnm-action-object.netlify.com/