Skip to content

Commit 727730f

Browse files
committed
adjust docs sync
1 parent 3db2be9 commit 727730f

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

.github/scripts/sync_docs.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ if [[ "${EVENT}" == "push" ]]; then
4545
destination="${DESTINATION_DIR}"
4646

4747
rsync_source="${SOURCE_DIR}/"
48-
rsync_destination="${destination}/"
48+
# Ensure we copy into the cloned fiber-docs directory so commits/push operate on the right repo
49+
rsync_destination="fiber-docs/${destination}/"
4950

50-
log "Preparing to sync files from '${rsync_source}' to 'fiber-docs/${rsync_destination}'"
51+
log "Preparing to sync files from '${rsync_source}' to '${rsync_destination}'"
5152

5253
mkdir -p "${rsync_destination}"
5354
log "Running rsync (verbose) to copy markdown files..."

.github/workflows/sync-docs.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ on:
88
paths:
99
- '**/*.md'
1010
workflow_dispatch:
11+
inputs:
12+
mode:
13+
description: 'Trigger mode: choose "push" to run the push flow or "release" to run the release flow'
14+
required: true
15+
default: 'push'
16+
tag_name:
17+
description: 'Tag name to use for release mode (optional when triggering manually)'
18+
required: false
19+
default: ''
1120
release:
1221
types: [published]
1322
branches:
@@ -33,8 +42,9 @@ jobs:
3342
- name: Sync docs
3443
run: ./.github/scripts/sync_docs.sh
3544
env:
36-
EVENT: ${{ github.event_name }}
37-
TAG_NAME: ${{ github.ref_name }}
45+
# If manually triggered, use the provided inputs; otherwise keep the event-driven values
46+
EVENT: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.mode || github.event_name }}
47+
TAG_NAME: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name || github.ref_name }}
3848
TOKEN: ${{ secrets.DOC_SYNC_TOKEN }}
39-
SOURCE_DIR: v3
40-
DESTINATION_DIR: docs/contrib
49+
SOURCE_DIR: 'v3'
50+
DESTINATION_DIR: 'docs/contrib'

0 commit comments

Comments
 (0)