diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml new file mode 100644 index 000000000..12138ee97 --- /dev/null +++ b/.github/workflows/sync-docs.yml @@ -0,0 +1,35 @@ +name: Sync docs to compass-docs + +on: + push: + branches: [main] + paths: + - 'docs/**' + workflow_dispatch: + +permissions: + contents: read + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/checkout@v4 + with: + repository: SwitchbackTech/compass-docs + token: ${{ secrets.COMPASS_DOCS_TOKEN }} + path: compass-docs + + - name: Sync docs + run: rsync -av --delete docs/ compass-docs/docs/ + + - name: Commit and push if changed + working-directory: compass-docs + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add -A + git diff --staged --quiet || git commit -m "sync: update docs from compass" + git push