Release Version [@coderabbitai ignore] #128
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .github/workflows/add-docs-to-release.yml | |
| name: Generate Docs | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| branches: | |
| - main | |
| jobs: | |
| generate-docs: | |
| if: github.repository == 'calycode/xano-tools' && github.repository_owner == 'calycode' && startsWith(github.head_ref, 'changeset-release') | |
| runs-on: ubuntu-latest | |
| env: | |
| TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ secrets.CHANGESETS_GH_TOKEN }} | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: true | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| cache: "pnpm" | |
| - name: Install packages | |
| run: pnpm install --frozen-lockfile | |
| - name: Build packages | |
| run: pnpm build | |
| - name: Build Docs | |
| run: pnpm build:docs | |
| - name: Add GH Identity | |
| run: | | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "Mihály Tóth" | |
| - name: Commit docs | |
| id: commit_docs | |
| run: | | |
| git add docs | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit." | |
| echo "commit=false" >> $GITHUB_OUTPUT | |
| else | |
| git commit -m "chore: update docs [skip ci]" | |
| echo "commit=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Push docs (only if commit was made) | |
| if: steps.commit_docs.outputs.commit == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git push origin HEAD:${GITHUB_HEAD_REF} --force-with-lease |