Skip to content

Commit 41499db

Browse files
committed
Add github action for docs
1 parent ab2657e commit 41499db

File tree

4 files changed

+4737
-1
lines changed

4 files changed

+4737
-1
lines changed

.github/workflows/api-docs.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: write api-docs to skip.kartverket.no
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
run-crdoc:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
packages: write
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
path: skiperator
17+
18+
- name: Run crdoc Docker container
19+
run: |
20+
pwd
21+
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
22+
ls
23+
24+
- name: Checkout target repository
25+
uses: actions/checkout@v4
26+
with:
27+
path: docs
28+
repository: kartverket/skip.kartverket.no
29+
ref: test
30+
ssh-key: ${{ secrets.SKIPDOCS_DEPLOY_KEY }}
31+
32+
- name: Copy generated output to target repo
33+
run: |
34+
pwd
35+
ls
36+
cp api-docs.md docs/docs/13-skiperator/04-api-docs.md
37+
38+
- name: Commit and push changes
39+
run: |
40+
ls
41+
pwd
42+
cd docs
43+
ls
44+
ls -l docs/13-skiperator
45+
git config --global user.email "[email protected]"
46+
git config --global user.name "GithubActions"
47+
git add .
48+
git commit -m "Update output.md"
49+
git push origin test

.github/workflows/test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ on:
77
- samples/**
88
- README.md
99
- CONTRIBUTING.md
10+
- .github/workflows/api-docs.yaml
1011
push:
1112
paths-ignore:
1213
- doc/**
1314
- samples/**
1415
- README.md
1516
- CONTRIBUTING.md
17+
- .github/workflows/api-docs.yaml
1618

1719
jobs:
1820
test:

0 commit comments

Comments
 (0)