Skip to content

Commit

Permalink
Add github action for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
martinhny committed Sep 10, 2024
1 parent ab2657e commit 21f9243
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/api-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: write api-docs to skip.kartverket.no

on:
push:

jobs:
run-crdoc:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- 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/config/crd --output /workdir/api-docs.md
- name: Checkout target repository
uses: actions/checkout@v4
with:
repository: kartverket/skip.kartverket.no
ref: test
ssh-key: ${{ secrets.SKIPDOCS_DEPLOY_KEY }}
# Step 4: Copy output.md from the source repo to the target repo
- name: Copy generated output to target repo
run: |
ls
cp /workdir/api-docs.md /docs/13-skiperator/04-api-docs.md # Update path as needed
# Step 5: Push the changes to the target branch
- 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 output.md"
git push origin test

0 comments on commit 21f9243

Please sign in to comment.