Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions .github/workflows/sync-docs.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
# ---
# yamllint disable rule:truthy
# name: Sync Folders
---
yamllint disable rule:truthy
name: Sync Folders

# on:
# push:
# branches:
# - stable
# paths:
# - 'docs/docs/**'
# - 'docs/sidebars.ts'
on:
push:
branches:
- stable
paths:
- 'docs/docs/**'
- 'docs/sidebars.ts'

# jobs:
# sync:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout source repository
# uses: actions/checkout@v4
# with:
# path: source-repo
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout source repository
uses: actions/checkout@v4
with:
path: source-repo

# - name: Checkout target repository
# uses: actions/checkout@v4
# with:
# repository: opsmill/infrahub-docs
# token: ${{ secrets.PAT_TOKEN }}
# path: target-repo
- name: Checkout target repository
uses: actions/checkout@v4
with:
repository: opsmill/infrahub-docs
token: ${{ secrets.PAT_TOKEN }}
path: target-repo

# - name: Sync folders
# run: |
# rm -rf target-repo/docs/docs-mcp/*
# rm -f target-repo/docs/sidebars-mcp.ts
# cp -r source-repo/docs/docs/* target-repo/docs/docs-mcp/
# cp source-repo/docs/sidebars.ts target-repo/docs/sidebars-mcp.ts
# cd target-repo
# git config user.name github-actions
# git config user.email [email protected]
# git add .
# if ! (git diff --quiet && git diff --staged --quiet); then git commit -m "Sync docs from mcp repo" && git push; fi
- name: Sync folders
run: |
rm -rf target-repo/docs/docs-mcp/*
rm -f target-repo/docs/sidebars-mcp.ts
cp -r source-repo/docs/docs/* target-repo/docs/docs-mcp/
cp source-repo/docs/sidebars.ts target-repo/docs/sidebars-mcp.ts
cd target-repo
git config user.name github-actions
git config user.email [email protected]
git add .
if ! (git diff --quiet && git diff --staged --quiet); then git commit -m "Sync docs from mcp repo" && git push; fi
Loading