Merge pull request #216 from Morwenn/develop #17
Workflow file for this run
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
# Copyright (c) 2020-2022 Morwenn | |
# SPDX-License-Identifier: MIT | |
name: Wiki Deployment | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'docs/**' | |
jobs: | |
sync-wiki-files: | |
name: Sync Wiki Files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout /docs | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{github.repository}} | |
path: main | |
- name: Checkout wiki | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{github.repository}}.wiki | |
path: wiki | |
- name: Sync wiki files | |
run: | | |
for docname in main/docs/*.md; do | |
old=$(basename "$docname"); | |
new=${old%.*}; | |
find main/docs -name "*.md" -exec sed -i "s/$old/$new/g" {} \; | |
done | |
rsync -avzr --delete --exclude='.git/' "main/docs/" "wiki/" | |
- name: Commit changes | |
working-directory: wiki | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Synchronize wiki with docs/" | |
- name: Push changes to wiki | |
uses: ad-m/github-push-action@master | |
with: | |
directory: wiki | |
repository: ${{github.repository}}.wiki | |
branch: master |