-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀 Merge pull request #1502 from Lissy93/FEAT/automate-documentation-s…
…ite-update [FEAT] Adds a GH workflow automation to sync docs to docs site
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
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. Copy /docs from master to website branch | ||
# 5. Run the script which processes documentation | ||
# 6. 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 "[email protected]" | ||
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 }} |