-
Notifications
You must be signed in to change notification settings - Fork 61
57 lines (49 loc) · 1.58 KB
/
update_on_push.yml
File metadata and controls
57 lines (49 loc) · 1.58 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Wiki Content Sync
on:
push:
branches:
- main
repository_dispatch:
types: [docs]
workflow_dispatch:
gollum:
env:
GIT_AUTHOR_NAME: GitHub Action
GIT_AUTHOR_EMAIL: action@github.com
GITHUB_REPO: ${{ github.server_url }}/${{ github.repository }}/blob/main
jobs:
sync-content-to-wiki:
if: always() && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref && github.event_name != 'gollum'
runs-on: [ ubuntu-latest ]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Group Document files
run: |
rsync -av \
--exclude='.git*' \
--exclude='LICENSE' \
--include='petshop/*' \
--exclude='petshop/*/*' \
--exclude='*/example-code/' \
--exclude='schedule/archive' \
--exclude='README.md' \
--exclude='instruction/template' \
./ docs/
find docs -empty -type d -delete
cp README.md docs/Home.md
cp -ar .github/structure/. docs/
- name: Install dependencies for renaming
run: |
python3 -m pip install --upgrade pip
- name: Rewrite markdown titles, filenames, and links
run: |
python3 .github/scripts/rewrite.py docs $GITHUB_REPO
- name: Sync docs to wiki
uses: newrelic/wiki-sync-action@v1.0.1
with:
source: docs
destination: wiki
token: ${{ secrets.WIKI_SYNC_SECRET }}
gitAuthorName: ${{ env.GIT_AUTHOR_NAME }}
gitAuthorEmail: ${{ env.GIT_AUTHOR_EMAIL }}