-
Notifications
You must be signed in to change notification settings - Fork 31
128 lines (105 loc) · 3.41 KB
/
cd-stage.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
name: cd-stage
on:
workflow_dispatch:
# inputs:
# build_pdf:
# description: 'build pdf book? (it is increase time workflow)'
# required: true
# default: 'no'
# type: choice
# options:
# - 'yes'
# - 'no'
push:
branches:
- 'dependabot/**'
env:
PUBLISH_BRANCH: web-page-stage
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/[email protected]
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
permissions:
contents: write
environment:
name: qmlc-web-page-stage
url: https://qmlc-web-page-stage.netlify.app
steps:
- name: checkout to build branch
uses: actions/checkout@v4
- name: set up poetry
uses: snok/install-poetry@v1
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/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./qmlcourse/_build/html/
publish_branch: ${{ env.PUBLISH_BRANCH }}
exclude_assets: './qmlcourse/_static/*'
# - name: build latex files
# if: github.event.inputs.build_pdf == 'yes'
# 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
# if: github.event.inputs.build_pdf == 'yes'
# continue-on-error: true
# run: |
# cd ./qmlcourse/_build/latex/
# xelatex -interaction=nonstopmode qmlcourse.tex
# - name: send pdf book to build branch
# if: github.event.inputs.build_pdf == 'yes'
# uses: peaceiris/[email protected]
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./qmlcourse/_build/latex/
# destination_dir: ./latex/
# publish_branch: ${{ env.PUBLISH_BRANCH }}