-
Notifications
You must be signed in to change notification settings - Fork 3
43 lines (37 loc) · 1.05 KB
/
push.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
34
35
36
37
38
39
40
41
42
43
name: Mirror to wiki
on: [push]
jobs:
mirror:
name: Mirror
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout current repository
uses: actions/checkout@v2
with:
path: ./mirror
- name: Checkout wiki repository
uses: actions/checkout@master
with:
repository: df-mc/dragonfly.wiki
token: ${{ secrets.ACTIONS_SECRET }}
path: ./wiki
- name: Remove ignored files
run: |
cd mirror
IGNORE=$(cat .wikiignore)
rm -rf $IGNORE
cd ..
- name: Apply changes
run: |
cp -a mirror/. wiki
- name: Push changes
run: |
cd wiki
if ! git diff --exit-code --quiet; then
git add .
git config user.name github-actions
git config user.email [email protected]
git commit -am "${{ github.event.head_commit.message }} (@${{ github.event.head_commit.author.name }})"
git push
fi