aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/update-documentation.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/update-documentation.yml')
-rw-r--r--.github/workflows/update-documentation.yml49
1 files changed, 49 insertions, 0 deletions
diff --git a/.github/workflows/update-documentation.yml b/.github/workflows/update-documentation.yml
new file mode 100644
index 0000000..cc7da8d
--- /dev/null
+++ b/.github/workflows/update-documentation.yml
@@ -0,0 +1,49 @@
+name: "Update Documentation"
+on:
+ push:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ generate:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Generate Documentation
+ uses: ./.github/devcontainers-action # devcontainers/action
+ with:
+ generate-docs: "true"
+ base-path-to-features: "./src"
+
+ - name: Add and Commit Documentation
+ id: push_image_info
+ run: |
+ set -e
+ echo "Start."
+
+ GIT_BRANCH=$(echo "${{ github.ref }}" | grep -oP 'refs/(heads|tags)/\K(.+)')
+ if [ "$GIT_BRANCH" == "" ]; then
+ echo "ERR: Could not determine branch."
+ exit 1
+ fi
+
+ echo "GIT_BRANCH = ${GIT_BRANCH}"
+
+ git config --global user.email "vscr-feedback@microsoft.com"
+ git config --global user.name "Devcontainers CI"
+ git config pull.rebase false
+
+ # # Pull in anything that may have come in
+ # git pull "https://ci:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" "HEAD:$GIT_BRANCH"
+
+ # Add / update and commit
+ git add */**/README.md
+ git status
+ git commit -m 'Automated documentation update' || export NO_UPDATES=true
+
+ # Push
+ if [ "$NO_UPDATES" != "true" ] ; then
+ git push "https://ci:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" "HEAD:$GIT_BRANCH"
+ fi \ No newline at end of file