forked from sckoarn/VHDL-Test-Bench
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.43 KB
/
Copy pathcommit.yml
File metadata and controls
45 lines (39 loc) · 1.43 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
name: commit
on:
# Runs after sphinx workflow completes successfully
workflow_run:
workflows: ["sphinx"]
types:
- completed
permissions:
contents: write
actions: read
jobs:
commit_docs:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch != '' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.workflow_run.head_branch }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download sphinx HTML artifact
uses: actions/download-artifact@v4
with:
name: sphinx_html
path: docs/html/
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Commit generated HTML documentation
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -f docs/html
if git diff --cached --quiet; then
echo "No generated documentation changes to commit."
exit 0
fi
git commit -m "Update generated HTML docs [skip ci]"
git push origin HEAD:${{ github.event.workflow_run.head_branch }}