mirror of
https://github.com/vee1e/bulk-questionnaire-upload.git
synced 2026-09-01 09:50:06 +00:00
feat: add GitHub Actions workflow to sync README files to Wiki
- Created a new workflow that triggers on pushes to the main branch and manual dispatch. - The workflow checks out the repository and the wiki, prepares the wiki content by copying README files, and commits changes if there are updates.
This commit is contained in:
parent
165b249c3d
commit
63307cab65
1 changed files with 39 additions and 0 deletions
39
.github/workflows/wiki-sync.yml
vendored
Normal file
39
.github/workflows/wiki-sync.yml
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
name: Sync READMEs to Wiki
|
||||
'on':
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- README.md
|
||||
- backend/README.md
|
||||
- frontend/README.md
|
||||
workflow_dispatch:
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Checkout wiki
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.repository }}.wiki
|
||||
path: wiki
|
||||
- name: Prepare wiki content
|
||||
run: |
|
||||
rm -rf wiki/*
|
||||
if [ -f README.md ]; then cp README.md wiki/Home.md; fi
|
||||
if [ -f backend/README.md ]; then cp backend/README.md wiki/Backend.md; fi
|
||||
if [ -f frontend/README.md ]; then cp frontend/README.md wiki/Frontend.md; fi
|
||||
- name: Commit and push
|
||||
run: |
|
||||
cd wiki
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
git add .
|
||||
git commit -m "Sync README to Wiki"
|
||||
git push
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue