-
Notifications
You must be signed in to change notification settings - Fork 5
49 lines (44 loc) · 1.38 KB
/
api-docs.yaml
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
name: write api-docs to skip.kartverket.no
on:
push:
branches:
- main
paths:
- 'config/crd/**'
jobs:
run-crdoc:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: skiperator
- name: Run crdoc Docker container
run: |
sudo docker run -u $(id -u):$(id -g) --rm -v $PWD:/workdir ghcr.io/fybrik/crdoc:latest --resources /workdir/skiperator/config/crd --output /workdir/api-docs.md
- name: Checkout target repository
uses: actions/checkout@v4
with:
path: docs
repository: kartverket/skip.kartverket.no
ssh-key: ${{ secrets.SKIPDOCS_DEPLOY_KEY }}
- name: Copy generated output to target repo
run: |
cp api-docs.md docs/docs/13-skiperator/04-api-docs.md
- name: Commit and push changes
run: |
cd docs
git config --global user.email "[email protected]"
git config --global user.name "GithubActions"
git add .
# Only commit if there are changes
git diff --cached --exit-code
if [ $? -eq 0 ]; then
echo "No changes to commit"
else
git commit -m "Update Skiperator api-docs"
git push origin main
fi