-
Notifications
You must be signed in to change notification settings - Fork 55
80 lines (69 loc) · 2.25 KB
/
update-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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Update Documentation
on:
workflow_dispatch:
workflow_call:
permissions:
actions: read
contents: write
jobs:
update-docs:
name: Update Documentation
runs-on: ubuntu-latest
steps:
- name: Find DocumentationCLI Binary
uses: actions/github-script@v7
id: find-doc-cli
with:
script: |
const response = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 1,
name: "DocumentationCLI"
});
return response.data.artifacts[0].workflow_run.id;
- name: Find Documentation
uses: actions/github-script@v7
id: find-documentation
with:
script: |
const response = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 1,
name: "Documentation"
});
return response.data.artifacts[0].workflow_run.id;
- name: Download DocumentationCLI
uses: actions/download-artifact@v4
with:
name: DocumentationCLI
run-id: ${{ steps.find-doc-cli.outputs.result }}
path: ${{ github.workspace }}
- name: Download Documentation
uses: actions/download-artifact@v4
with:
name: DocumentationCLI
run-id: ${{ steps.find-documentation.outputs.result }}
path: ${{ github.workspace }}
- name: Checkout Repository
uses: actions/checkout@v4
with:
path: FicsItNetworks
ref: refs/heads/development
- name: Update Documentation
run: |
./FicsItNetworksDocumentationCLI -i ./FicsItNetworks/docs/FINDocumentation.toml ./FINDocumentation.json
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Commit
working-directory: FicsItNetworks
run: |
git add docs
git commit -m "docs: Automatic Documentation Update"
- name: Push
working-directory: FicsItNetworks
run: |
git push