-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 2.65 KB
/
docs-sync.yml
File metadata and controls
56 lines (48 loc) · 2.65 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
49
50
51
52
53
54
55
56
name: Docs Sync
on:
push:
tags:
- "v*" # release tags (e.g., v1.0.0)
branches:
- development # dev branch pushes
workflow_dispatch: # manual trigger
jobs:
push-doc:
runs-on: ubuntu-latest
steps:
# 1. Checkout current repo
- name: Checkout this repo
uses: actions/checkout@v3
# 2. Clone central docs repo
- name: Clone central docs repo
run: |
git clone https://x-access-token:${{ secrets.DOCS_REPO_TOKEN }}@github.com/rakurai-io/rakurai-docs.git
# 3. Create directory structure and copy files
- name: Copy docs into structured directories
run: |
REPO_NAME=${{ github.event.repository.name }}
# Create program subdirectories dynamically
mkdir -p rakurai-docs/docs/services/$REPO_NAME/programs/rakurai_activation
mkdir -p rakurai-docs/docs/services/$REPO_NAME/programs/rakurai_activation/idl
mkdir -p rakurai-docs/docs/services/$REPO_NAME/programs/reward_distribution
mkdir -p rakurai-docs/docs/services/$REPO_NAME/programs/reward_distribution/idl
mkdir -p rakurai-docs/docs/services/$REPO_NAME/programs/tip_manager
mkdir -p rakurai-docs/docs/services/$REPO_NAME/programs/tip_manager/idl
mkdir -p rakurai-docs/docs/services/$REPO_NAME/cli
# Copy README.md files
cp programs/rakurai_activation/README.md rakurai-docs/docs/services/$REPO_NAME/programs/rakurai_activation/README.md
cp programs/rakurai_activation/idl/rakurai_activation.json rakurai-docs/docs/services/$REPO_NAME/programs/rakurai_activation/idl/rakurai_activation.json
cp programs/reward_distribution/README.md rakurai-docs/docs/services/$REPO_NAME/programs/reward_distribution/README.md
cp programs/reward_distribution/idl/reward_distribution.json rakurai-docs/docs/services/$REPO_NAME/programs/reward_distribution/idl/reward_distribution.json
cp programs/tip_manager/README.md rakurai-docs/docs/services/$REPO_NAME/programs/tip_manager/README.md
cp programs/tip_manager/idl/tip_manager.json rakurai-docs/docs/services/$REPO_NAME/programs/tip_manager/idl/tip_manager.json
cp cli/README.md rakurai-docs/docs/services/$REPO_NAME/cli/README.md
# 4. Commit & push
- name: Commit and push
run: |
cd rakurai-docs
git config user.name "saadkhan2495"
git config user.email "saadkhan2495@gmail.com"
git add docs/services/${{ github.event.repository.name }}/ 2>/dev/null || true
git diff --cached --quiet || git commit -m "Update ${{ github.event.repository.name }} doc"
git push