GitHub actions

# Automatic publishing with Gitlab

If you use GitHub, then you can use GitHub actions to automatically publish your docs after pushing your to your repository.

# Set up your secrets

First of all, you'll have to add your gendocs-token to the GitHub secrets. You can find those at:

Repository page -> Settings -> Secrets -> Add Secret

We've named this variable GENDOCS_TOKEN

# Add your workflow

Add the directory .github/workflows to your project.

In this directory, add a file named gendocs.yml with the following content:

yml
name: Gendocs Publish

# Execute this workflow 
on:
  push:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    # Checkout your repository files to be used in this workflow
    - uses: actions/checkout@v2
    # Install nodejs 10
    - name: Use Node.js 10
      uses: actions/setup-node@v1
      with:
        node-version: '10'
    # Install gendocs
    - run: npm install -g @invacto/gendocs
    # Run gendocs publish
    - shell: bash
      env:
        GENDOCS_TOKEN: ${{ secrets.GENDOCS_TOKEN }}
      run: gendocs publish $GENDOCS_TOKEN