-
Notifications
You must be signed in to change notification settings - Fork 3
198 lines (167 loc) · 6.92 KB
/
main.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: 'CD for generate book and docs folder'
env:
ChaptersMD : Chapter01/readme.md Chapter02/readme.md Chapter03/readme.md Chapter04/readme.md Chapter05/readme.md Chapter06/readme.md Chapter07/readme.md
on:
push:
paths:
- '**.md'
- '**.yml'
- '**.txt'
- '**.json'
- '**.js'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: generate pdf
run: |
chmod +x ./print/getBook.bat
cd print
./getBook.bat
ls -lh
cp ./book.pdf ../docs/ConsoleToSaas.pdf
cp ./Chapter01.svg ../docs/Chapter01.svg
cp ./Chapter02.svg ../docs/Chapter02.svg
cp ./Chapter03.svg ../docs/Chapter03.svg
cp ./Chapter04.svg ../docs/Chapter04.svg
cp ./Chapter05.svg ../docs/Chapter05.svg
cp ./Chapter06.svg ../docs/Chapter06.svg
cp ./Chapter07.svg ../docs/Chapter07.svg
# cp ./Chapter01.svg ../Chapter01/Chapter01.svg
# cp ./Chapter02.svg ../Chapter02/Chapter02.svg
# cp ./Chapter03.svg ../Chapter03/Chapter03.svg
# cp ./Chapter04.svg ../Chapter04/Chapter04.svg
# cp ./Chapter05.svg ../Chapter05/Chapter05.svg
- name: upload pdf to artifacts
uses: actions/upload-artifact@v1
with:
name: ConsoleToSaas.pdf
path: ./print/book.pdf
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "generate pdf" -a --allow-empty
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
convert_via_pandoc:
runs-on: ubuntu-18.04
needs: build
steps:
- uses: actions/checkout@v2
- run: |
echo chapters to generate $ChaptersMD
git pull
mkdir output
- name: generate odt
uses: docker://pandoc/latex:2.9
with: # needs a README in your repo root!
args: "cover.md README.md Chapter01/readme.md Chapter02/readme.md Chapter03/readme.md Chapter04/readme.md Chapter05/readme.md Chapter06/readme.md Chapter07/readme.md conclusions.md --standalone -f gfm -t odt --toc -o output/output.odt --metadata title=CLI/Console2SAAS"
- name: generate epub
uses: docker://pandoc/latex:2.9
with: # needs a README in your repo root!
args: "cover.md README.md Chapter01/readme.md Chapter02/readme.md Chapter03/readme.md Chapter04/readme.md Chapter05/readme.md Chapter06/readme.md Chapter07/readme.md conclusions.md --standalone -f gfm -t epub --toc -o output/output.epub --metadata title=CLI/Console2SAAS"
- name: generate docx
uses: docker://pandoc/latex:2.9
with: # needs a README in your repo root!
args: "cover.md README.md Chapter01/readme.md Chapter02/readme.md Chapter03/readme.md Chapter04/readme.md Chapter05/readme.md Chapter06/readme.md Chapter07/readme.md conclusions.md --standalone -f gfm -t docx --toc -o output/output.docx --metadata title=CLI/Console2SAAS"
- name: generate html
uses: docker://pandoc/latex:2.9
with: # needs a README in your repo root!
#args: "--standalone --output=output/README.html README.md"
args: "cover.md README.md Chapter01/readme.md Chapter02/readme.md Chapter03/readme.md Chapter04/readme.md Chapter05/readme.md Chapter06/readme.md Chapter07/readme.md conclusions.md --standalone -f gfm -t html --include-in-header=header.txt --toc -o output/output.html --metadata title=CLI/Console2SAAS"
- uses: actions/upload-artifact@master
with:
name: output
path: output
- run: |
cp ./output/output.html ./docs/index.html
cp ./output/output.epub ./docs/ConsoleToSaas.epub
cp ./output/output.docx ./docs/ConsoleToSaas.docx
cp ./output/output.odt ./docs/ConsoleToSaas.odt
rm -rf ./output
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "generate html" -a --allow-empty
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
zipSources:
runs-on: ubuntu-latest
needs: [build,convert_via_pandoc]
steps:
- uses: actions/checkout@v2
- name: pulling latest
run: |
echo chapters to generate $ChaptersMD
git pull
rm ./docs/sources/*.zip
# - uses: montudor/[email protected]
# with:
# args: zip -qq -r ./Chapter01.zip ./docs/sources/Chapter01.zip
- name: Zip Release Chapter01
uses: TheDoctor0/[email protected]
with:
filename: ./docs/sources/Chapter01.zip
path: ./Chapter01/FastExtractDocumentMetadata
- name: Zip Release Chapter02
uses: TheDoctor0/[email protected]
with:
filename: ./docs/sources/Chapter02.zip
path: ./Chapter02/FastExtractDocumentMetadata
- name: Zip Release Chapter03
uses: TheDoctor0/[email protected]
with:
filename: ./docs/sources/Chapter03.zip
path: ./Chapter03/FastExtractDocumentMetadata
- name: Zip Release Chapter04
uses: TheDoctor0/[email protected]
with:
filename: ./docs/sources/Chapter04.zip
path: ./Chapter04/FastExtractDocumentMetadata
- name: Zip Release Chapter05
uses: TheDoctor0/[email protected]
with:
filename: ./docs/sources/Chapter05.zip
path: ./Chapter05/FastExtractDocumentMetadata
- name: Zip Release Chapter06
uses: TheDoctor0/[email protected]
with:
filename: ./docs/sources/Chapter06.zip
path: ./Chapter06/FastExtractDocumentMetadata
- name: Zip Release Chapter07
uses: TheDoctor0/[email protected]
with:
filename: ./docs/sources/Chapter07.zip
path: ./Chapter07/FastExtractDocumentMetadata
# - name: Zip Release Chapter05
# uses: TheDoctor0/[email protected]
# with:
# filename: ./docs/sources/Chapter05.zip
# path: ./Chapter05/FastExtractDocumentMetadata
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add --all
git commit -m "generate zip files" -a --allow-empty
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# runs-on: windows-latest
# # runs:
# # using: 'docker'
# # image: 'print/exportPDF.txt'
# steps:
# - uses: actions/checkout@v2
# - name: print pdf
# run: |
# cd print
# ./getBook.bat