From 0229ad6a76e61990983dd7c5e00e4fc0fdd43d98 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 6 Mar 2024 22:15:09 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Adds=20a=20GH=20workflow=20autom?= =?UTF-8?q?ation=20to=20sync=20docs=20to=20docs=20site?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/update-docs-site.yml | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/update-docs-site.yml diff --git a/.github/workflows/update-docs-site.yml b/.github/workflows/update-docs-site.yml new file mode 100644 index 00000000..58e64330 --- /dev/null +++ b/.github/workflows/update-docs-site.yml @@ -0,0 +1,57 @@ +name: 📝 Update Documentation + +# This will run whenever the /docs directory in master branch is updated, +# or if the workflow is manually dispatched, plus a sync check on Sun at 03:30 UTC +on: + workflow_dispatch: + schedule: + - cron: '30 3 * * 0' + push: + branches: + - master + paths: + - 'docs/**' + + +# Jobs to be run: +# 1. Checkout master branch +# 2. Checkout website source code branch +# 3. Install Python +# 4. Run the script which processes documentation +# 5. Commit and push updated docs to the website source code branch +jobs: + update-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout master branch 🛎️ + uses: actions/checkout@v2 + with: + path: 'master-docs' + + - name: Checkout WEBSITE/docs-site-source branch 🛎️ + uses: actions/checkout@v2 + with: + ref: 'WEBSITE/docs-site-source' + path: 'website-docs' + + - name: Install Python 🐍 + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Run script to update documentation 🪄 + run: | + cp -r master-docs/docs website-docs/docs + python website-docs/do-markdown-magic.py + working-directory: website-docs + + - name: Commit changes 🚀 + run: | + cd website-docs + git config --local user.email "liss-bot@d0h.co" + git config --local user.name "Liss-Bot" + git add docs + git commit -m "Update documentation" || echo "No changes to commit" + git push + env: + GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}