Skip to content

Commit

Permalink
Add github action for docs (#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinhny authored Sep 11, 2024
1 parent ab2657e commit 1811ebe
Show file tree
Hide file tree
Showing 4 changed files with 4,730 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/api-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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: |
git config --global user.email "[email protected]"
git config --global user.name "GithubActions"
git add .
git commit -m "Update Skiperator api-docs"
git push origin main
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ on:
- samples/**
- README.md
- CONTRIBUTING.md
- .github/workflows/api-docs.yaml
push:
paths-ignore:
- doc/**
- samples/**
- README.md
- CONTRIBUTING.md
- .github/workflows/api-docs.yaml

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource called `Application`.
Below you will find a list of all accepted input parameters to the `Application`
custom resource.

To see explanations and requirements for all inputs, see the documentation under [the API documentation](https://doc.crds.dev/github.com/kartverket/skiperator).
To see explanations and requirements for all inputs, see the documentation under [the API documentation](https://skip.kartverket.no/docs/skiperator).

```yaml
apiVersion: skiperator.kartverket.no/v1alpha1
Expand Down
Loading

0 comments on commit 1811ebe

Please sign in to comment.