forked from WolveJC/ACADE-Prog
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (66 loc) · 2.48 KB
/
build-docs.yml
File metadata and controls
84 lines (66 loc) · 2.48 KB
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
name: Build Docs
on:
push:
branches: [ "main" ]
workflow_dispatch:
permissions:
contents: write # habilita escritura en el repo con GITHUB_TOKEN
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Python deps
run: |
pip install markdown pandocfilters emoji requests
- name: Generate projects.json
run: python scripts/scan_projects.py
- name: Generate GLOBAL.md
run: python scripts/concat_readmes.py
- name: Install Pandoc
run: sudo apt-get update && sudo apt-get install -y pandoc
- name: Install LaTeX engine and fonts
run: sudo apt-get install -y texlive texlive-xetex texlive-fonts-recommended texlive-latex-extra
- name: Install SVG support
run: sudo apt-get install -y librsvg2-bin
- name: Install DejaVu fonts
run: sudo apt-get install -y fonts-dejavu
- name: Prepare font header
run: |
cat > pandoc-fonts.tex <<'EOF'
\usepackage{fontspec}
\setmainfont{DejaVu Sans}
\setsansfont{DejaVu Sans}
\setmonofont{DejaVu Sans Mono}
EOF
- name: Convert to PDF
run: pandoc GLOBAL.md -o doc_proj.pdf --pdf-engine=xelatex --include-in-header=pandoc-fonts.tex --filter ./scripts/emoji_filter.py
- name: Move artifacts into repo
run: |
mkdir -p Wolves-Page/public/docs
mkdir -p Wolves-Page/src/data
mv doc_proj.pdf Wolves-Page/public/docs/doc_proj.pdf
mv projects.json Wolves-Page/src/data/projects_list.json
- name: Commit and push artifacts
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add Wolves-Page/public/docs/doc_proj.pdf Wolves-Page/src/data/projects_list.json
git commit -m "Update docs and projects list [CI]" || echo "No changes to commit"
git push
- name: Prepare Pages content
run: |
mkdir -p _site
cp GLOBAL.md _site/GLOBAL.md
- name: Deploy GLOBAL.md to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: _site
keep_files: true