forked from fnbrjs/fnbr.js
-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (64 loc) · 1.92 KB
/
docgen.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
name: "CI"
on:
push:
branches:
- '*'
- '!docs'
tags:
- '*'
jobs:
docgen:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Setup git
run: |
git config --global user.name "FNBR Bot"
git config --global user.email fnbr@tusinean.ro
- name: Set Up NodeJS
uses: actions/setup-node@v2
with:
node-version: 20
- name: Checkout Main Repository
uses: actions/checkout@v2
with:
path: main
- name: Checkout Main Repository Docs Branch
uses: actions/checkout@v2
with:
path: docs
ref: docs
- name: Checkout DocGen Repository
uses: actions/checkout@v2
with:
repository: fnbrjs/docgen
token: ${{ secrets.BOT_PAT }}
path: docgen
- name: Install Main Repository Dependencies
working-directory: ./main
run: npm ci
- name: Install DocGen Dependencies
working-directory: ./docgen
run: npm ci
- name: Compile DocGen
working-directory: ./docgen
run: npm run build
- name: Generate Documentation
working-directory: ./docgen
run: node . ../main
- uses: actions-ecosystem/action-regex-match@v2
id: current_branch
with:
text: ${{ github.ref }}
regex: '(?<=\/)(\w|\d|\.)+$'
- name: Deploy Documentation
working-directory: ./docs
shell: bash
env:
CURRENT_BRANCH: ${{ steps.current_branch.outputs.match }}
run: |
git pull https://fnbr-bot:${{ secrets.BOT_PAT }}@github.com/fnbrjs/fnbr.js docs
mv ../docgen/docs.json ./${CURRENT_BRANCH}.json
git add . -A
git commit -m "Docs build for ${CURRENT_BRANCH}: ${GITHUB_SHA}"
git push https://fnbr-bot:${{ secrets.BOT_PAT }}@github.com/fnbrjs/fnbr.js docs