-
Notifications
You must be signed in to change notification settings - Fork 44
98 lines (85 loc) · 2.88 KB
/
upload-docx.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
name: Generate DOCX
on:
push:
branches:
- 'latest'
- '2.11'
jobs:
generate-singlehtml:
runs-on: ubuntu-latest
container: tarantool/doc-builder:fat-4.3
steps:
- uses: actions/checkout@v3
id: checkout
with:
submodules: recursive
- name: preprare modules
run: |
cmake .
make pull-modules
make build-modules
- name: make singlehtml-en
run: |
make singlehtml
- name: save singlehtml-en
uses: actions/upload-artifact@v3
with:
name: singlehtml-en
path: output/singlehtml/en/alternate_build_master.html
- name: make singlehtml-ru
run: make singlehtml-ru
- name: save singlehtml-ru
uses: actions/upload-artifact@v3
with:
name: singlehtml-ru
path: output/singlehtml/ru/alternate_build_master.html
- name: save pandoc filters from the repo
uses: actions/upload-artifact@v3
with:
name: pandoc
path: pandoc/filter-espd.py
generate-docx:
needs: generate-singlehtml
runs-on: ubuntu-latest
container: ghcr.io/tarantool/pandoc-builder:latest
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}}
S3_ENDPOINT_URL: ${{secrets.S3_ENDPOINT_URL}}
S3_UPLOAD_PATH: ${{secrets.S3_DOCX_PATH}}
steps:
- name: download artifacts
uses: actions/download-artifact@v3
- name: generate docx-en
run: |
pandoc singlehtml-en/alternate_build_master.html \
--standalone \
--verbose \
--from html \
--to docx \
--output tarantool-en.docx \
--metadata lang=en \
--metadata toc-title='Table of content' \
--filter pandoc/filter-espd.py \
--table-of-contents \
--toc-depth=2
- name: generate docx-ru
run: |
pandoc singlehtml-ru/alternate_build_master.html \
--standalone \
--verbose \
--from html \
--to docx \
--output tarantool-ru.docx \
--metadata lang=ru \
--metadata toc-title='Оглавление' \
--filter pandoc/filter-espd.py \
--table-of-contents \
--toc-depth=2
- name: Get branch name
run: echo "DEPLOYMENT_NAME=$(echo ${{ github.ref }} | sed -r 's|^.*/.*/(.*)$|\1|')" >> $GITHUB_ENV
- name: upload docx
run: |
aws s3 cp tarantool-en.docx ${{ env.S3_UPLOAD_PATH }}/${{ env.DEPLOYMENT_NAME }}/ --endpoint-url=${{ env.S3_ENDPOINT_URL }}
aws s3 cp tarantool-ru.docx ${{ env.S3_UPLOAD_PATH }}/${{ env.DEPLOYMENT_NAME }}/ --endpoint-url=${{ env.S3_ENDPOINT_URL }}