-
Notifications
You must be signed in to change notification settings - Fork 13
52 lines (45 loc) · 1.79 KB
/
generate-docs.yml
File metadata and controls
52 lines (45 loc) · 1.79 KB
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
49
50
51
52
name: Generate Docs
on:
pull_request:
branches:
- main
- "releases/**"
jobs:
gendoc:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2
# Set up Go environment
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # actions/setup-go@v5.2.0
- name: Setup GitHub Token
id: setup-github-token
uses: smartcontractkit/.github/actions/setup-github-token@ef78fa97bf3c77de6563db1175422703e9e6674f # setup-github-token@0.2.1
with:
aws-role-arn: ${{ secrets.AWS_OIDC_DEV_PLATFORM_READ_REPOS_EXTERNAL_TOKEN_ISSUER_ROLE_ARN }}
aws-lambda-url: ${{ secrets.AWS_DEV_SERVICES_TOKEN_ISSUER_LAMBDA_URL }}
aws-region: ${{ secrets.AWS_REGION }}
aws-role-duration-seconds: "1800" # this is optional and defaults to 900
set-git-config: true
# Temporarily remove everything in the docs folder to easily detect all diffs, including command removals
- name: Clean up docs folder
run: rm -f docs/*
# Regenerate the documentation
- name: Generate docs
env:
GITHUB_TOKEN: ${{ steps.setup-github-token.outputs.access-token }}
run: go run gendoc/main.go
# Compare if generated docs are different from the docs on this git branch
- name: Compare generated docs
run: |
git diff --stat --exit-code ./docs || {
echo "Please generate docs locally and commit the changes.";
echo "To achieve this, you can run the following command:";
echo "make gendoc";
exit 1;
}