softplayer-proto/.woodpecker/documentation.yaml

34 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2024-03-18 13:20:24 +00:00
---
when:
event:
- push
2024-03-19 15:43:40 +00:00
branch: main
2024-03-18 13:20:24 +00:00
steps:
lint:
name: Generate docs
image: pseudomuto/protoc-gen-doc
secrets:
- softplayer_bot_ssh_key
- git_known_hosts
commands:
- mkdir -p ~/.ssh
- apk update && apk add git openssh
- echo $SOFTPLAYER_BOT_SSH_KEY | base64 -d > ~/.ssh/id_ed25519
- echo $GIT_KNOWN_HOSTS > ~/.ssh/known_hosts
- cat ~/.ssh/id_ed25519
- chmod 0600 ~/.ssh/id_ed25519
2024-05-06 07:37:02 +00:00
- protoc --proto_path=./proto --doc_out=. --doc_opt=markdown,README.md $(find ./proto -type f -iname "*.proto")
2024-05-06 07:43:25 +00:00
# To make sure there is always a change, even when protos are not updated
- echo "Generated on $(date)" >> README.md
2024-03-18 13:20:24 +00:00
- eval `ssh-agent`
- ssh-add ~/.ssh/id_ed25519
- git config --global user.email "allanger@badhouseplants.net"
- git config --global user.name "Softplayer Bot"
- git clone git@git.badhouseplants.net:softplayer/softplayer-proto.git /tmp/repo
- git -C /tmp/repo checkout generated-documentation
- mv README.md /tmp/repo/README.md
- git -C /tmp/repo add .
2024-05-06 07:43:25 +00:00
- git -C /tmp/repo commit -m "Update documentation from $CI_COMMIT_SHA"
2024-03-18 13:20:24 +00:00
- git -C /tmp/repo push