diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 288c9e8..72fd010 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -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 github-actions@github.com -# 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 github-actions@github.com + git add . + if ! (git diff --quiet && git diff --staged --quiet); then git commit -m "Sync docs from mcp repo" && git push; fi diff --git a/README.md b/README.md index f057c75..e344222 100644 --- a/README.md +++ b/README.md @@ -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/) diff --git a/docs/sidebars.ts b/docs/sidebars.ts index 6056455..c42e7ac 100644 --- a/docs/sidebars.ts +++ b/docs/sidebars.ts @@ -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', + ], + }, ] };