name: Generate Documentation on: workflow_dispatch: workflow_run: workflows: [ 'CI' ] branches: [ main ] types: - completed jobs: docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Use NodeJS 20.x uses: actions/setup-node@v1 with: node-version: '20.x' - run: npm ci - name: Prepare documentation run: npm run prepare-docs - name: Generate documentation uses: nikeee/docfx-action@v1.0.0 with: args: docfx.json - name: Check for changes id: check_changes run: | git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT - name: Update branch if: steps.check_changes.outputs.changed == 'true' run: | git config user.name github-actions git config user.email github-actions@github.com git add docs git commit -m "Updated /docs" git push