-
Notifications
You must be signed in to change notification settings - Fork 5
43 lines (35 loc) · 1.23 KB
/
update-documentation.yml
File metadata and controls
43 lines (35 loc) · 1.23 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
name: "Update Documentation"
on:
workflow_dispatch:
permissions:
contents: write
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate Documentation
uses: devcontainers/action@v1.4.3
with:
generate-docs: "true"
base-path-to-templates: "./src"
- name: Create a branch for documentation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
echo "Start."
# Configure git and Push updates
git config --global user.email github-actions@github.com
git config --global user.name github-actions
git config pull.rebase false
branch=automated-documentation-update-$GITHUB_RUN_ID
git checkout -b $branch
# Add / update and commit
git add */**/README.md
git commit -m 'Automated documentation update' || export NO_UPDATES=true
# Push to temporary branch. Changes should be manually added to a separate branch (PR),
# since signed automated commits aren't easily supported on GitHub Actions (yet).
if [ "$NO_UPDATES" != "true" ] ; then
git push origin "$branch"
fi