GitLab CI

# Automatic publishing with GitLab

If you use GitLab, then you can set up gitLab-ci to automatically deploy whenever you push to gitLab.

# Set your token as a variable

You will need access to your gendocs-token in GitLab without having to pass it through git.

That's where GitLab variables come in.

Go to: PROJECT -> Settings -> CI/CD -> Variables and add a variable.

Name it: GENDOCS_TOKEN and set the value to your token (see your gendocs-token file)

# Add gitLab-ci.yml

Then simply add a ".gitLab-ci.yml" file to your projects root directory with the following content.

yml
image: node:10

gendocs:
  script:
    - npm install -g @invacto/gendocs
    - gendocs publish $GENDOCS_TOKEN

That's it, just git push your project and your docs will automatically update.