Skip to content

Commit 4dc14c3

Browse files
committed
🚦 Add automatic doc generation workflow
1 parent 9e13c4a commit 4dc14c3

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Generate documentation
2+
on:
3+
push:
4+
branches: master
5+
6+
jobs:
7+
build:
8+
name: Generate documentation
9+
runs-on: ubuntu-latest
10+
defaults:
11+
run:
12+
shell: bash
13+
permissions:
14+
contents: write
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
21+
fetch-depth: 0
22+
23+
- name: Setup Go
24+
uses: actions/setup-go@v4
25+
with:
26+
go-version: '>=1.21.0'
27+
28+
- name: Generate documentation
29+
run: |
30+
rm docs/*.md
31+
go run ./tools/generate-docs
32+
33+
- name: Add changes
34+
id: add
35+
uses: ./git/add
36+
37+
- name: Commit changes
38+
if: fromJson(steps.add.outputs.staged)
39+
uses: ./git/commit
40+
with:
41+
title: 📄 Update generated documentation
42+
body: |
43+
This commits the output of the `generate-docs` tool.
44+
45+
Source-commit: ${{ github.sha }}
46+
Workflow-run-id: ${{ github.run_id }}
47+
48+
- name: Push generated changes
49+
if: fromJson(steps.add.outputs.staged)
50+
uses: ./git/push
51+
with:
52+
branch: master
53+

0 commit comments

Comments
 (0)