Skip to content

Commit e11c40c

Browse files
committed
feat: add docs sync workflow for palmshed/cursor-docs
1 parent b1a1dcc commit e11c40c

2 files changed

Lines changed: 89 additions & 0 deletions

File tree

.github/workflows/docs-sync.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: docs-sync
2+
on:
3+
push:
4+
branches: [main]
5+
paths: ['docs/**']
6+
workflow_dispatch:
7+
jobs:
8+
sync:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
path: source
14+
- uses: actions/checkout@v4
15+
with:
16+
repository: palmshed/cursor-docs
17+
token: ${{ secrets.DOCS_SYNC_TOKEN }}
18+
path: dest
19+
- run: |
20+
rm -rf dest/docs
21+
cp -r source/docs dest/
22+
rm -f dest/sync.md
23+
- run: |
24+
cd dest
25+
git config user.name 'brand-cursor[bot]'
26+
git config user.email 'brand-cursor[bot]@users.noreply.github.com'
27+
git add -A
28+
git diff --quiet && echo "no changes" || git commit -m "sync docs from cursor@$GITHUB_SHA"
29+
git push

docs/sync.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Docs Sync Setup
2+
3+
## 1. Create the docs repo
4+
5+
https://github.com/organizations/palmshed/repositories/new
6+
7+
Repo name: cursor-docs
8+
Visibility: public (for Pages)
9+
10+
## 2. Create a GitHub PAT
11+
12+
Settings > Developer settings > Personal access tokens > Fine-grained tokens
13+
14+
Repository access: Only select repositories → palmshed/cursor-docs
15+
Permissions: Contents (Read and write)
16+
17+
## 3. Add the PAT as a repo secret in the main repo
18+
19+
Settings > Secrets and variables > Actions > New repository secret
20+
21+
Name: DOCS_SYNC_TOKEN
22+
Secret: (the token from step 2)
23+
24+
## 4. Enable Pages on the docs repo
25+
26+
In palmshed/cursor-docs: Settings > Pages > Source: GitHub Actions
27+
28+
## 5. Add the Pages workflow to the docs repo
29+
30+
Push this as `.github/workflows/pages.yml` in the docs repo:
31+
32+
```yaml
33+
name: Pages
34+
on:
35+
push:
36+
branches: [main]
37+
workflow_dispatch:
38+
permissions:
39+
contents: read
40+
pages: write
41+
id-token: write
42+
deployments: write
43+
concurrency:
44+
group: pages
45+
cancel-in-progress: false
46+
jobs:
47+
deploy:
48+
runs-on: ubuntu-latest
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: actions/configure-pages@v6
55+
- uses: actions/upload-pages-artifact@v3
56+
with:
57+
path: '.'
58+
- id: deployment
59+
uses: actions/deploy-pages@v4
60+
```

0 commit comments

Comments
 (0)