-
Notifications
You must be signed in to change notification settings - Fork 922
85 lines (82 loc) · 2.53 KB
/
main.yaml
File metadata and controls
85 lines (82 loc) · 2.53 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
85
name: CI
on: [push, pull_request]
jobs:
pre-commit:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-python@v6
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
sudo apt update
sudo apt install \
fontconfig \
imagemagick \
poppler-utils
python -m pip install --upgrade pip
pip install -r requirements/requirements.txt
- name: Install Tex Live
run: |
sudo apt update
sudo apt install \
texlive-base \
texlive-extra-utils \
texlive-fonts-extra \
texlive-fonts-recommended \
texlive-latex-base \
texlive-latex-extra \
texlive-latex-recommended \
texlive-xetex
- name: Build artifacts
run: |
# adjust the ImageMagick policies to convert PDF to PNG
# remove all policies restricting Ghostscript ability to process files
# https://stackoverflow.com/q/52998331
# https://stackoverflow.com/a/59193253
sudo sed -i '/disable ghostscript format types/,+6d' /etc/ImageMagick-6/policy.xml
#
make -C fonts/
cp -r fonts/ /usr/share/fonts/
fc-cache
make all
- name: Run checks
run: |
make check
- uses: actions/upload-artifact@v7
if: ${{ always() }}
with:
name: build
path: |
cheatsheets.pdf
handout-*.pdf
./docs/_build/html/
- uses: actions/upload-artifact@v7
id: diffs-artifact-upload
if: ${{ always() }}
with:
name: diffs
path: |
diffs/
- name: Publish cheatsheets and handouts
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html/
force_orphan: true