name: docusaurus

on:
  push:
    branches:
      - master
      - develop
    paths:
      - docusaurus/**
jobs:
  push_docusaurus:
    name: Publish docusaurus docs
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Setup Node 16
        uses: actions/setup-node@v3
        with:
          node-version: 16
      - name: push
        uses: GetStream/push-stream-chat-docusaurus-action@main
        with: 
          target-branch: ${{ github.ref == 'refs/heads/master' && 'production' || 'staging' }}
        env:
          DOCUSAURUS_GH_TOKEN: ${{ secrets.DOCUSAURUS_GH_TOKEN }}
