diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 288c9e8..b40dbb1 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -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 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