-
Notifications
You must be signed in to change notification settings - Fork 56
91 lines (72 loc) · 2.88 KB
/
docs.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
---
name: docs
on:
push:
pull_request:
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
docs:
runs-on: ubuntu-latest
name: 📚 Docs
steps:
- name: 🧰 Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: 📂 Load .env file
if: hashFiles('.github/workflows/.env') != ''
uses: xom9ikk/dotenv@v2
with:
path: .github/workflows
- name: 🟨 Install TinyTeX
uses: r-lib/actions/setup-tinytex@v2
env:
TINYTEX_INSTALLER: TinyTeX-0
- name: 🟨 Install LaTeX packages
run: |
tlmgr install latex-bin newunicodechar latex-tools-dev courier dvips wasy epstopdf-pkg helvetic etoc caption pdftexcmds hyperref tocloft natbib fancyhdr changepage geometry psnfss ec ulem intcalc alphalph enumitem etoolbox stackengine amsfonts adjustbox iftex hanging pmboxdraw ltxcmds kvsetkeys kvdefinekeys infwarerr kvoptions float xcolor colortbl varwidth fancyvrb multirow epstopdf
tlmgr list --only-installed
- name: 🐍 Install Conda environment
uses: mamba-org/setup-micromamba@v1.4.4
with:
environment-file: .github/workflows/micromamba/docs.yml
environment-name: docs
- name: ⬇️ Setup CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: ^3
ninjaVersion: ^1.11.1
- name: 🔧 Configure
run: cmake -S ${{ env.CMAKE_SOURCE_PREFIX }} -B ${{ env.CMAKE_BINARY_PREFIX }} -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DCMAKE_PREFIX_PATH="~/micromamba" -DCMAKE_INSTALL_PREFIX=${{ env.CMAKE_INSTALL_PREFIX }} -D CPPTERMINAL_ENABLE_DOCS=ON
- name: ⚙️ Build
run: cmake --build ${{ env.CMAKE_BINARY_PREFIX }} --config ${{ env.CMAKE_BUILD_TYPE }} --parallel ${{ env.CMAKE_NUMBER_JOBS }} --target all docs
- name: 📥 Install
run: cmake --install ${{ env.CMAKE_BINARY_PREFIX }} --prefix ${{ env.CMAKE_INSTALL_PREFIX }} --strip && mv ${{ env.CMAKE_INSTALL_PREFIX }}/share/doc/cpp-terminal/pdf/cpp-terminal_Manual.pdf ${{ env.CMAKE_INSTALL_PREFIX }}/share/doc/cpp-terminal/html/cpp-terminal_Manual.pdf
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ${{ env.CMAKE_INSTALL_PREFIX }}/share/doc/cpp-terminal/html/
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs: docs
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2