added new publish_docs_to_wiki.yml task

This commit is contained in:
chris 2023-04-20 22:41:47 -04:00
parent a5d4fca039
commit 72f74d14d0
2 changed files with 46 additions and 2 deletions

View file

@ -0,0 +1,45 @@
name: Publish docs to Wiki
# Trigger this action only if there are changes pushed to the docs/** directory under the main branch
on:
push:
paths:
- doc/** # This includes all sub folders
branches:
- main # This can be changed to any branch of your preference
env:
USER_TOKEN: ${{ secrets.WIKI_ACTION_TOKEN }} # This is the repository secret
USER_NAME: stupid-deploy-bot # Enter the username of your (bot) account
USER_EMAIL: 76802126+stupid-deploy-bot@users.noreply.github.com # Enter the e-mail of your (bot) account
OWNER: ${{ github.event.repository.owner.name }} # This is the repository owner
REPOSITORY_NAME: ${{ github.event.repository.name }} # This is the repository name
jobs:
publish_docs_to_wiki:
name: Publish docs to Wiki
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout repository
# 1. Create folder named `tmp_wiki`
# 2. Initialize Git
# 3. Pull old Wiki content
- name: Pull content from wiki
run: |
mkdir tmp_wiki
cd tmp_wiki
git init
git config user.name $USER_NAME
git config user.email $USER_EMAIL
git pull https://$USER_TOKEN@github.com/$OWNER/$REPOSITORY_NAME.wiki.git
# 4. Synchronize differences between `docs` & `tmp_wiki`
# 5. Push new Wiki content
- name: Push content to wiki
run: |
rsync -av --delete docs/ tmp_wiki/ --exclude .git
cd tmp_wiki
git add .
git commit -m "Update Wiki content"
git push -f --set-upstream https://$USER_TOKEN@github.com/$OWNER/$REPOSITORY_NAME.wiki.git master

View file

@ -33,4 +33,3 @@ then build it using command
or building it under the Visual Studio 2019
(set the OrcaSlicer_app_gui as start project)
![image](https://user-images.githubusercontent.com/106916061/179185940-06135b47-f2a4-415a-9be4-666680fa0f9a.png)