-
-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (82 loc) · 2.19 KB
/
docs.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Deploy Docs
on:
push:
branches:
- master
paths:
- "docs/**"
- ".github/workflows/docs.yml"
tags:
- v*
- git-v*
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
repository_dispatch:
types: [docs]
gollum:
permissions:
contents: read
jobs:
job-sync-docs-to-wiki:
permissions:
contents: write
runs-on: ubuntu-latest
if: github.event_name != 'gollum'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Sync docs to wiki
uses: newrelic/wiki-sync-action@v1.0.1
with:
source: docs
destination: wiki
token: ${{ secrets.DOTFILES_GITHUB_TOKEN }}
job-sync-wiki-to-docs:
permissions:
contents: write
runs-on: ubuntu-latest
if: github.event_name == 'gollum'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Sync Wiki to Docs
uses: newrelic/wiki-sync-action@v1.0.1
with:
source: wiki
destination: docs
token: ${{ secrets.DOTFILES_GITHUB_TOKEN }}
branch: master
deploy:
needs:
- job-sync-docs-to-wiki
- job-sync-wiki-to-docs
# run if any of the previous jobs succeeded
if: ${{ always() }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout Latest Wiki Content
uses: actions/checkout@v4
- name: Checkout github-wikito-converter
uses: actions/checkout@v4
with:
repository: yakivmospan/github-wikito-converter
path: github-wikito-converter
- name: Build and Install github-wikito-converter globally
run: |
cd github-wikito-converter
npm install
npm run build
cd ..
- name: Build Docs
run: |
mkdir public
node ./github-wikito-converter/dist/cli/gwtc.js --file-name index --output ./public --toc-level 3 ./docs
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public