Update SDK docs #72
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
| name: Update SDK docs | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" # Runs at 00:00 UTC every day | |
| workflow_dispatch: # Allows manual triggering | |
| jobs: | |
| update-sdk-pages: | |
| runs-on: ubuntu-slim | |
| env: | |
| FRONTEND_REF: main | |
| steps: | |
| - name: Generate app token | |
| id: app-token | |
| uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2.2.2 | |
| with: | |
| app-id: ${{ secrets.TAILOR_DOCS_BOT_APP_ID }} | |
| private-key: ${{ secrets.TAILOR_DOCS_BOT_PRIVATE_KEY }} | |
| - name: Checkout current repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| ref: main | |
| path: docs | |
| - name: Checkout sdk repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| repository: tailor-platform/sdk | |
| ref: ${{ env.FRONTEND_REF }} | |
| path: sdk | |
| - name: Set up Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: "24" | |
| - name: Install dependencies for docs-sync script | |
| working-directory: docs/scripts/docs-sync | |
| run: npm ci | |
| - name: Sync the docs files | |
| working-directory: docs/scripts/docs-sync | |
| run: npm start -- sdk | |
| - name: Check for changes | |
| working-directory: docs | |
| id: git_diff | |
| run: | | |
| git config --global --add safe.directory $PWD | |
| git add -A | |
| if git diff --staged --quiet; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push changes | |
| if: steps.git_diff.outputs.changed == 'true' | |
| working-directory: docs | |
| run: | | |
| git config user.name "tailor-docs-bot[bot]" | |
| git config user.email "tailor-docs-bot[bot]@users.noreply.github.com" | |
| git commit -m "Update SDK pages" | |
| git push origin main |