2022-06-14 03:01:19 +03:00
|
|
|
name: "Update Documentation"
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
generate:
|
|
|
|
runs-on: ubuntu-latest
|
2022-08-19 21:14:03 +03:00
|
|
|
if: "github.ref == 'refs/heads/main'"
|
2022-06-14 03:01:19 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Generate Documentation
|
2022-08-18 02:19:46 +03:00
|
|
|
uses: devcontainers/action@v1
|
2022-06-14 03:01:19 +03:00
|
|
|
with:
|
|
|
|
generate-docs: "true"
|
|
|
|
base-path-to-features: "./src"
|
|
|
|
|
|
|
|
- name: Add and Commit Documentation
|
|
|
|
id: push_image_info
|
2022-08-03 01:34:24 +03:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-06-14 03:01:19 +03:00
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
echo "Start."
|
|
|
|
|
2022-08-03 01:34:24 +03:00
|
|
|
# Configure git and Push updates
|
|
|
|
git config --global user.email github-actions@github.com
|
|
|
|
git config --global user.name github-actions
|
2022-06-14 03:01:19 +03:00
|
|
|
git config pull.rebase false
|
|
|
|
|
2022-08-03 01:34:24 +03:00
|
|
|
branch=automated-documentation-update-$GITHUB_RUN_ID
|
|
|
|
git checkout -b $branch
|
|
|
|
message='Automated documentation update'
|
2022-06-14 03:01:19 +03:00
|
|
|
|
|
|
|
# Add / update and commit
|
|
|
|
git add */**/README.md
|
2022-08-19 21:14:03 +03:00
|
|
|
git commit -m 'Automated documentation update [skip ci]' || export NO_UPDATES=true
|
2022-06-14 03:01:19 +03:00
|
|
|
|
|
|
|
# Push
|
|
|
|
if [ "$NO_UPDATES" != "true" ] ; then
|
2022-08-03 01:34:24 +03:00
|
|
|
git push origin "$branch"
|
|
|
|
gh pr create --title "$message" --body "$message"
|
|
|
|
fi
|