Skip to content

Layer improvements (#327) #13

Layer improvements (#327)

Layer improvements (#327) #13

Workflow file for this run

name: Publish docs to Wiki
# Trigger this action only if there are changes pushed to the wiki/** directory under the main branch
on:
push:
paths:
- wiki/** # 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: ${{ github.actor }}
USER_EMAIL: ${{ github.event.pusher.email }}
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:
- name: Checkout repository
uses: actions/checkout@v4
# 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
- name: Get last commit info
run: echo "COMMIT_NAME=$(git log --oneline -n 1 -- wiki/)" >> $GITHUB_OUTPUT
id: commit
# 4. Synchronize differences between `wiki` & `tmp_wiki`
# 5. Push new Wiki content
- name: Push content to wiki
run: |
rsync -av --delete wiki/ tmp_wiki/ --exclude .git
cd tmp_wiki
git add .
git commit -m "${{ steps.commit.outputs.COMMIT_NAME }}"
git push -f --set-upstream https://$USER_TOKEN@github.com/$OWNER/$REPOSITORY_NAME.wiki.git master