-
-
Notifications
You must be signed in to change notification settings - Fork 116
48 lines (42 loc) · 1.4 KB
/
generate-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This workflow assumes that a `grain-linux-x64` binary was uploaded earlier within the same Action run.
# It downloads the binary, regenerates the documentation for the project, and pushes it to the ref that was checked out.
# Note: the `ref` should always be a branch for successful pushes!
name: Generate documentation
on:
workflow_call:
inputs:
ref:
description: Git reference to checkout
type: string
required: false
secrets:
PUSH_TOKEN:
description: Token used to push back to repository
required: true
jobs:
generate-docs:
name: Generate documentation
runs-on: ubuntu-latest
steps:
- name: Setup bot user
run: |
git config --global user.email "[email protected]"
git config --global user.name "Grain Bot"
- name: Checkout project
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
token: ${{ secrets.PUSH_TOKEN }}
- name: Fetch linux binary
uses: actions/download-artifact@v4
with:
name: grain-linux-x64
- name: Untar download
run: |
tar -xvf grain.tar
- name: Regenerate documentation
run: |
./grain doc stdlib -o stdlib --current-version=$(./grain -v)
git add stdlib
git commit --allow-empty -m 'chore(stdlib): Regenerate markdown documentation'
git push