-
Notifications
You must be signed in to change notification settings - Fork 9
67 lines (57 loc) · 2.46 KB
/
Copy pathsync-docs-to-kitops.yml
File metadata and controls
67 lines (57 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Sync docs to KitOps repository
on:
workflow_call:
workflow_dispatch:
env:
KITOPS_PATH: "kitops-clone"
PYKITOPS_DOCS_PATH: "docs/src/docs/pykitops"
jobs:
sync-docs-to-kitops:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 ## v3.2.0
with:
app-id: ${{ vars.KITOPS_BOT_ID }}
private-key: ${{ secrets.KITOPS_BOT_PRIVATE_KEY }}
owner: kitops-ml
- name: Checkout pykitops repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 ## v7.0.0
- name: Checkout KitOps repository to subdirectory
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 ## v7.0.0
with:
token: ${{ steps.generate-token.outputs.token }}
repository: kitops-ml/kitops
ref: main
path: ${{ env.KITOPS_PATH }}
- name: Copy pykitops docs into KitOps docs dir
run: |
# Remove existing directory to ensure any old files are removed
rm -rf "${KITOPS_PATH}/${PYKITOPS_DOCS_PATH}"
mkdir -p "${KITOPS_PATH}/${PYKITOPS_DOCS_PATH}"
cp -r docs/* "${KITOPS_PATH}/${PYKITOPS_DOCS_PATH}"
- name: Get short SHA output
id: get-sha
run: |
SHA=${{ github.sha }}
echo "sha=${SHA:0:10}" >> $GITHUB_OUTPUT
- name: Open PR in KitOps repo with docs changes
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 ## v8.1.1
with:
path: ${{ env.KITOPS_PATH }}
token: ${{ steps.generate-token.outputs.token }}
commit-message: |
Update pykitops documentation
Update pykitops documentation to reflect commit ${{ github.sha }}
in repository ${{ github.server_url }}/${{ github.repository }}
title: Update PyKitOps documentation
body: |
Update the pykitops section of the documentation to reflect commit
[`${{ steps.get-sha.outputs.sha }}`](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
in ${{ github.server_url }}/${{ github.repository }}
branch: pykitops-docs-update
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor_id }}@users.noreply.github.com>
signoff: true
delete-branch: true