-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (65 loc) · 2.17 KB
/
documentation.yml
File metadata and controls
77 lines (65 loc) · 2.17 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Documentation
on:
workflow_dispatch:
schedule:
# Run once every week on Sunday
- cron: 0 0 * * 0
push:
paths:
# Or if an include has been updated
- 'manifests/*.toml'
# Manual trigger
- 'trigger.txt'
jobs:
documentation:
name: Build Documentations
runs-on: ubuntu-latest
steps:
- name: Checkout manifests
uses: actions/checkout@v2
with:
ref: "master"
path: "manifests"
- name: Checkout bundles
uses: actions/checkout@v2
with:
ref: "bundles"
path: "bundles"
- name: Download Chumbucket
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "sourcemod-dev/docgen"
version: "tags/cb-0.4.3"
file: "chumbucket"
- name: Chumbucket +x
run: sudo chmod +x chumbucket
- name: Process manifests
run: |
for i in manifests/manifests/*.toml; do
[ -f "$i" ] || break
export manifest_file=$(basename -- "$i")
echo "Processing $manifest_file"
if [ -f "bundles/${manifest_file%.*}.bundle" ]; then
./chumbucket generate manifests/manifests/$manifest_file -b bundles/${manifest_file%.*}.bundle -o bundles/${manifest_file%.*}.bundle
else
./chumbucket generate manifests/manifests/$manifest_file -o bundles/${manifest_file%.*}.bundle
fi
done
ls -l bundles/
- name: Process bundle index
run: |
if [ -f "bundles/index" ]; then
./chumbucket build-index bundles -i bundles/index -o bundles/index
else
./chumbucket build-index bundles -o bundles/index
fi
- name: Commit changes
working-directory: bundles
run: |
if [ -n "$(git status --porcelain)" ]; then
git config --global user.name 'rumblefrog'
git config --global user.email 'contact@rumblefrog.me'
git add -A
git commit -m 'Bundle generations'
git push
fi