Add a sync job to push docs changes to the kitops repo#1
Conversation
There was a problem hiding this comment.
Pull request overview
Adds GitHub Actions automation to sync documentation changes from kitops-ts into the main kitops-ml/kitops repository by copying docs and opening/refreshing a PR.
Changes:
- Added a push-triggered workflow that runs when
docs/**changes onmain. - Added a reusable workflow that checks out both repos, copies docs into
kitops/docs/kitops-ts, and opens a PR inkitops.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
.github/workflows/docs-sync.yml |
Triggers the reusable sync workflow on docs/** changes to main. |
.github/workflows/sync-docs-to-kitops.yml |
Implements the sync logic: token creation, dual checkout, file copy, and PR creation in kitops. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a2b8512 to
1c4e1e2
Compare
Signed-off-by: Javis Pérez <javis@jozu.com>
1c4e1e2 to
76ab90e
Compare
Signed-off-by: Javis Pérez <javis@jozu.com>
Signed-off-by: Javis Pérez <javis@jozu.com>
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "docs/**" |
There was a problem hiding this comment.
I think we can just move this trigger into sync-docs-to-kitops.yml and avoid having to call it separately, not entirely sure why this job exists only to call the second job without doing anything else
There was a problem hiding this comment.
Aha I see you've already changed it
There was a problem hiding this comment.
yes sir! thanks for the idea 🎉
| on: | ||
| workflow_call: | ||
| secrets: | ||
| KITOPS_BOT_PRIVATE_KEY: | ||
| required: true | ||
| workflow_dispatch: |
There was a problem hiding this comment.
E.g.
| on: | |
| workflow_call: | |
| secrets: | |
| KITOPS_BOT_PRIVATE_KEY: | |
| required: true | |
| workflow_dispatch: | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "docs/**" | |
| workflow_dispatch: |
| - name: Checkout kitops-ts repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Checkout KitOps repository to subdirectory | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| token: ${{ steps.generate-token.outputs.token }} | ||
| repository: kitops-ml/kitops | ||
| ref: main | ||
| path: ${{ env.KITOPS_PATH }} |
There was a problem hiding this comment.
This can be made a tiny bit cleaner by copying both repos to separate paths (this was will put kitops-clone as a subdirectory in kitops-ts) but it's not terribly important.
This pull request introduces automation for syncing documentation changes from the
kitops-tsrepository to the mainKitOpsrepository. The workflow ensures that any updates to the documentation inkitops-tsare automatically copied and a pull request is opened in theKitOpsrepository, streamlining the process and reducing manual effort.Documentation sync automation:
.github/workflows/docs-sync.ymlto trigger a sync workflow when changes are pushed to thedocsdirectory on themainbranch..github/workflows/sync-docs-to-kitops.ymlworkflow to handle the actual syncing process, including generating a GitHub App token, checking out both repositories, copying documentation files, and opening a pull request in theKitOpsrepository with the updated docs.