From c985e415f29d8b7d591e1b5147d5e22cb4576264 Mon Sep 17 00:00:00 2001 From: Chris Reed Date: Sun, 29 May 2022 17:45:38 -0500 Subject: [PATCH] workflows: add deploy-docs workflow to auto update website on docs changes --- .github/workflows/deploy-docs.yaml | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/deploy-docs.yaml diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml new file mode 100644 index 000000000..de61a5b0f --- /dev/null +++ b/.github/workflows/deploy-docs.yaml @@ -0,0 +1,39 @@ +name: Deploy docs + +# Only run when docs are modified on the main branch. +on: + push: + branches: + - main + paths: + - 'docs/**' + +jobs: + deploy: + runs-on: ubuntu-latest + environment: docs-deployment + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + repository: 'pyocd/pyocd-website-source' + token: ${{ secrets.DEPLOY_TOKEN }} + submodules: true + + - name: Configure user + run: | + git config --global user.email "pyocd-bot-noreply@pyocd.io" + git config --global user.name "pyocd-bot" + + - name: Update pyocd submodule + run: | + cd pyocd + git fetch origin + git switch --detach ${{ github.event.after }} + + - name: Commit and push + run: | + git add pyocd + git commit -m "submodule: pyocd: sync to commit ${{ github.event.after }}" + git push origin +