Skip to content

Commit e0b6b0a

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

File tree

3 files changed

+4731
-0
lines changed

3 files changed

+4731
-0
lines changed

.github/workflows/api-docs.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
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
21+
22+
- name: Checkout target repository
23+
uses: actions/checkout@v4
24+
with:
25+
path: docs
26+
repository: kartverket/skip.kartverket.no
27+
ref: test
28+
ssh-key: ${{ secrets.SKIPDOCS_DEPLOY_KEY }}
29+
# Step 4: Copy output.md from the source repo to the target repo
30+
- name: Copy generated output to target repo
31+
run: |
32+
ls ../../..
33+
ls
34+
pwd
35+
cp api-docs.md /docs/docs/13-skiperator/04-api-docs.md # Update path as needed
36+
37+
# Step 5: Push the changes to the target branch
38+
- name: Commit and push changes
39+
run: |
40+
git config --global user.email "[email protected]"
41+
git config --global user.name "GithubActions"
42+
git add .
43+
git commit -m "Update output.md"
44+
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)