Sync PDMShell Docs #64
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: Sync PDMShell Docs | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: [docs-updated] | |
| permissions: | |
| contents: write | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm sync-docs | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Commit and push if changed | |
| id: commit | |
| run: | | |
| git diff --quiet server/utils/pdmshell-docs.ts && echo "changed=false" >> "$GITHUB_OUTPUT" && exit 0 | |
| git config user.name "gns-x" | |
| git config user.email "gns-x@users.noreply.github.com" | |
| git add server/utils/pdmshell-docs.ts | |
| git commit -m "docs: sync pdmshell-docs from upstream" | |
| git push | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| - name: Deploy to Vercel | |
| if: steps.commit.outputs.changed == 'true' | |
| run: npx vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }} | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} |