-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (37 loc) · 1.1 KB
/
wiki.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
name: Publish Docs to Wiki
on:
push:
paths:
- docs/**
branches: [main]
# Allow manual trigger (workflow_dispatch)
workflow_dispatch:
env:
USER_TOKEN: ${{ secrets.WIKI_DEPLOY_TOKEN }}
USER_NAME: svcfmtm
USER_EMAIL: [email protected]
ORG: hotosm
REPO_NAME: ${{ github.event.repository.name }}
jobs:
publish_docs_to_wiki:
name: Publish Docs to Wiki
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- 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://[email protected]/$ORG/$REPO_NAME.wiki.git
- name: Push content to wiki
run: |
apt update && apt install -y rsync
rsync -av --delete docs/ tmp_wiki/ --exclude .git
cd tmp_wiki
git add .
git commit -m "docs: automated wiki update on push"
git push -f --set-upstream https://[email protected]/$ORG/$REPO_NAME.wiki.git master