Skip to content
Merged
Show file tree
Hide file tree
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
71 changes: 36 additions & 35 deletions .github/workflows/sync-docs.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
# ---
# yamllint disable rule:truthy
# name: Sync Folders
---
# yamllint disable rule:truthy rule:truthy rule:line-length
name: Sync Docs Folders

# on:
# push:
# branches:
# - stable
# paths:
# - 'docs/docs/**'
# - 'docs/sidebars.ts'
on:
workflow_dispatch:
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@v5
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.GH_INFRAHUB_BOT_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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Infrahub MCP Server connects your AI assistants to Infrahub using the open MCP s

## Using Infrahub MCP

Documentation for using Infrahub Sync is available [here](https://docs.infrahub.app/mcp/)
Documentation for using Infrahub MCP is available [here](https://docs.infrahub.app/mcp/)
16 changes: 14 additions & 2 deletions docs/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
const sidebars: SidebarsConfig = {
mcpSidebar: [
'readme',
'guides/installation',
'references/methods',
{
type: 'category',
label: 'Guides',
items: [
'guides/installation',
],
},
{
type: 'category',
label: 'Reference',
items: [
'references/methods',
],
},
]
};

Expand Down