-
Notifications
You must be signed in to change notification settings - Fork 13
70 lines (64 loc) · 1.69 KB
/
documentation_sync.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Documentation Sync
on:
push:
env:
GIT_AUTHOR_NAME: Actionbot
GIT_AUTHOR_EMAIL: actions@github.com
permissions:
actions: write
checks: write
contents: write
deployments: write
id-token: write
issues: write
discussions: write
packages: write
pages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write
jobs:
job-create-docs-directory:
runs-on: ubuntu-latest
steps:
- name: Check if Docs Directory Exists
run: |
if [ ! -d "docs" ]; then
echo "Creating docs directory..."
mkdir docs
else
echo "Docs directory already exists."
fi
job-sync-docs-to-wiki:
runs-on: ubuntu-latest
if: github.event_name =~ 'gollum'
needs: job-create-docs-directory
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Sync docs to wiki
uses: newrelic/wiki-sync-action@main
with:
source: docs
destination: wiki
token: ${{ secrets.GITHUB_TOKEN }}
gitAuthorName: ${{ env.GIT_AUTHOR_NAME }}
gitAuthorEmail: ${{ env.GIT_AUTHOR_EMAIL }}
branch: main
job-sync-wiki-to-docs:
runs-on: ubuntu-latest
if: github.event_name == 'gollum'
needs: job-create-docs-directory
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Sync Wiki to Docs
uses: newrelic/wiki-sync-action@main
with:
source: wiki
destination: docs
token: ${{ secrets.GITHUB_TOKEN }}
gitAuthorName: ${{ env.GIT_AUTHOR_NAME }}
gitAuthorEmail: ${{ env.GIT_AUTHOR_EMAIL }}
branch: main