name: Generate documentation

on:
  push:
    tags:
      - '*'


jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      with:
        ref: ${{ github.head_ref }}
    - name: Use Node.js
      uses: actions/setup-node@v2
      with:
        node-version: 15.x
        cache: 'npm'
    - run: npm ci
    - run: npm run styleguide:build
    - name: Commit documentation
      uses: EndBug/add-and-commit@v7 # You can change this to use a specific version.
      with:
        add: 'docs'
        author_name: github-bot
        author_email: github-bot@users.noreply.github.com
        branch: master
        message: 'Update documentation'
