1+ # .github/workflows/lectures.yml
2+
3+ name : Build and Deploy Lectures
4+
5+ on :
6+ push :
7+ branches : [ main ] # или ваша основная ветка
8+ workflow_dispatch :
9+
10+ jobs :
11+ build-and-deploy :
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Checkout repository
16+ uses : actions/checkout@v4
17+
18+ - name : Install full TeX Live (with XeLaTeX and Cyrillic support)
19+ run : |
20+ sudo apt-get update
21+ sudo apt-get install -y \
22+ texlive-xetex \
23+ texlive-latex-recommended \
24+ texlive-latex-extra \
25+ texlive-fonts-recommended \
26+ texlive-lang-cyrillic \
27+ fonts-dejavu fonts-freefont-otf fonts-freefont-ttf
28+
29+ - name : Create output directory
30+ run : mkdir -p lectures/dist
31+
32+ - name : Compile .tex files with XeLaTeX
33+ run : |
34+ cd lections
35+ for texfile in lecture*.tex; do
36+ if [ -f "$texfile" ]; then
37+ filename="${texfile%.tex}"
38+ echo "Compiling $texfile → $filename.pdf"
39+ # Первый проход
40+ xelatex -interaction=nonstopmode "$texfile"
41+ # Второй проход (для ссылок, TOC и т.д.)
42+ xelatex -interaction=nonstopmode "$texfile"
43+ # Копируем PDF в целевую папку
44+ mv "${filename}.pdf" ../lectures/dist/
45+ # Опционально: удаляем временные файлы
46+ rm -f "${filename}.aux" "${filename}.log" "${filename}.out" "${filename}.toc"
47+ fi
48+ done
49+
50+ - name : Copy .txt files
51+ run : |
52+ cp lections/lecture04_android_coroutines.txt lectures/dist/
53+
54+ - name : Deploy to pages branch
55+ uses : peaceiris/actions-gh-pages@v4
56+ with :
57+ github_token : ${{ secrets.GITHUB_TOKEN }}
58+ publish_dir : ./dist
59+ publish_branch : pages
60+ keep_files : true
0 commit comments