-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.26 KB
/
sync-docs.yml
File metadata and controls
48 lines (39 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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 }}