-
Notifications
You must be signed in to change notification settings - Fork 31
110 lines (87 loc) · 2.84 KB
/
cd-prod.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
name: cd-prod
on:
workflow_dispatch:
push:
branches:
- master
env:
PUBLISH_BRANCH: web-page-prod
jobs:
generate-plantuml-diagrams:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: checkout to build branch
uses: actions/checkout@v4
- name: generate `**.svg` for `**.plantuml`
uses: holowinski/plantuml-github-action@main
with:
args: -v -tsvg **.plantuml
- name: push diagrams to runing branch
uses: EndBug/add-and-commit@v9.1.4
with:
message: auto-generate `**.svg` for `**.plantuml`
create-folder-for-latex:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: checkout to build branch
uses: actions/checkout@v4
with:
ref: ${{ env.PUBLISH_BRANCH }}
- name: create `./latex/`
run: |
mkdir -p ./latex/
build-and-deploy-book:
needs: [generate-plantuml-diagrams, create-folder-for-latex]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: checkout branch for build
uses: actions/checkout@v4
- name: set up poetry
uses: snok/install-poetry@v1.3.3
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: set up python
uses: actions/setup-python@v5
with:
python-version: 3.8
cache: 'poetry'
- name: install dependencies
run: |
poetry install --no-interaction --no-root
- name: build the book
id: build_book
env:
DWAVE_TOKEN: ${{ secrets.DWAVE_TOKEN }}
run: |
poetry run jupyter-book toc migrate ./qmlcourse/_toc.yml -o ./qmlcourse/_toc.yml
poetry run jupyter-book build ./qmlcourse
- name: update publish dir to build branch
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./qmlcourse/_build/html/
publish_branch: ${{ env.PUBLISH_BRANCH }}
# - name: build latex files
# env:
# DWAVE_TOKEN: ${{ secrets.DWAVE_TOKEN }}
# run: |
# sudo apt-get install texlive-latex-extra texlive-fonts-extra texlive-xetex latexmk
# poetry run jupyter-book build ./qmlcourse --builder latex
# - name: create pdf book
# continue-on-error: true
# run: |
# cd ./qmlcourse/_build/latex/
# xelatex -interaction=nonstopmode qmlcourse.tex
# - name: send pdf book to build branch
# uses: peaceiris/actions-gh-pages@v4.0.0
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./qmlcourse/_build/latex/
# destination_dir: ./latex/
# publish_branch: ${{ env.PUBLISH_BRANCH }}