From 2fa323248528604a3548fd1292c74c7b473c611b Mon Sep 17 00:00:00 2001 From: Josh Spicer Date: Mon, 13 Jun 2022 20:01:19 -0400 Subject: Devcontainer docs (#47) * docs * automatically generate documentation from features.json * trigger doc gen * 1 * no-ci * no-ci * no-ci * no-ci * comment out pull * Automated documentation update * no-ci markdown table * Automated documentation update * no-ci * Automated documentation update * branch to main Co-authored-by: Devcontainers CI --- .github/workflows/release-v1.yaml | 2 +- .github/workflows/release.yaml | 2 +- .github/workflows/update-documentation.yml | 49 ++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/update-documentation.yml (limited to '.github/workflows') diff --git a/.github/workflows/release-v1.yaml b/.github/workflows/release-v1.yaml index cc5e42a..adbfab9 100644 --- a/.github/workflows/release-v1.yaml +++ b/.github/workflows/release-v1.yaml @@ -22,7 +22,7 @@ jobs: run: sudo apt install tree -y && tree - name: Generate tgz - uses: microsoft/publish-dev-container-features-action@main # devcontainers/action + uses: microsoft/publish-dev-container-features-action@main with: publish-features: "true" path-to-features: "./src" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c271e03..4b59eb9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v2 - name: Generate tgz - uses: ./.github/devcontainers-action # devcontainers/ci + uses: ./.github/devcontainers-action # devcontainers/action with: publish-features: "true" base-path-to-features: "./src" 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 -- cgit v1.2.3