Skip to content

Merge pull request #2 from getsynq/feature/examples #7

Merge pull request #2 from getsynq/feature/examples

Merge pull request #2 from getsynq/feature/examples #7

name: generate docs
on:
push:
branches:
- main
paths:
- 'protos/**'
- 'generate_docs.sh'
- '.github/workflows/generate_docs.yaml'
workflow_dispatch:
concurrency:
cancel-in-progress: true
group: api-generate-docs-${{ github.head_ref || github.run_id }}
defaults:
run:
shell: bash
jobs:
generate:
if: '!contains(github.event.commits[0].message, ''ci skip'')'
runs-on: ubuntu-latest
env:
CI_COMMIT_MESSAGE: Generated API Docs
CI_COMMIT_AUTHOR_NAME: Synqlair
CI_COMMIT_AUTHOR_EMAIL: ci@synq.io
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: "21.x"
- name: Install protoc generators
run: |
go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
- name: Generate and push
run: |
bash generate_docs.sh
git config --global user.name "${{ env.CI_COMMIT_AUTHOR_NAME }}"
git config --global user.email "${{ env.CI_COMMIT_AUTHOR_EMAIL }}"
git add docs
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push
timeout-minutes: 5