# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Build docs

on:
  push:
    branches:
      - master # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
  build:
    name: Build Docs
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Build Docs
        run: |
          yarn global add react-docgen
          export PATH="$PATH:`yarn global bin`"
          cd docs
          react-docgen ../src/*
          react-docgen ../src/* | ../buildDocs.sh
      - name: Push to Master
        run: |
          git config --global user.name 'Ali Kazemkhanloo'
          git config --global user.email 'alikazemkhanloo@gmail.com'
          git add .
          git commit -m 'update docs'
          git push
