-
Notifications
You must be signed in to change notification settings - Fork 64
63 lines (58 loc) · 1.89 KB
/
components-to-doc.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
name: Components to Documents
on:
push:
paths:
- templates/meshmodel/components/**
release:
types: [published]
jobs:
CopyComponents:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Make components to .md files
run: |
function join_by {
local d=${1-} f=${2-}
if shift 2; then
echo "$f${@/#/$d}"
fi
}
mkdir output
folder_path=templates/meshmodel/components/*
for file in $folder_path;
do
folder_name="$file/*"
onlyfolder=$(basename "$file")
echo "---
component: $onlyfolder
integrations:" > $onlyfolder.md
for indFile in $folder_name;
do
filename=$(basename "$indFile")
temp_filename=$filename
IFS="."
read -ra newarr <<< "$temp_filename"
IFS=""
if [[ "${newarr[7]}" == "schema" ]]
then
continue
fi
ans=$(join_by . ${newarr[0]} ${newarr[1]})
echo " - $ans" >> $onlyfolder.md
done
echo "---" >> $onlyfolder.md
mv $onlyfolder.md output
done
- name: Pushes folder to main repo
uses: crykn/[email protected]
env:
API_TOKEN_GITHUB: ${{ secrets.GH_ACCESS_TOKEN }}
with:
source_folder: 'output'
destination_repo: 'meshery/meshery'
destination_folder: 'docs/_integrations/linkerd'
destination_branch: 'master'
user_email: '[email protected]'
user_name: 'l5io'
commit_msg: 'Adapters Component added'