forked from KudryashevLab/TomoBEAR
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (31 loc) · 927 Bytes
/
wiki-mirror.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: "Mirror wiki/ to repo.wiki"
# Run on changes to the `wiki` directory on the `main` branch
on:
push:
branches:
- main
paths:
- 'wiki/**'
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v3
with:
path: TomoBEAR
- name: Checkout wiki
uses: actions/checkout@v3
with:
repository: "KudryashevLab/TomoBEAR.wiki"
path: TomoBEAR.wiki
- name: Copy wiki files
run: |
git config --global user.email "[email protected]"
git config --global user.name "Wiki mirror"
cp $GITHUB_WORKSPACE/TomoBEAR/wiki/*.md $GITHUB_WORKSPACE/TomoBEAR.wiki
cd $GITHUB_WORKSPACE/TomoBEAR.wiki
git add .
# only commit if there are changes
git diff-index --quiet HEAD -- || git commit -m "sync from wiki/"
git push