mirror of
https://github.com/cupcakearmy/memoir.git
synced 2025-01-02 21:36:25 +00:00
add latex pipeline
This commit is contained in:
parent
67aca792cf
commit
e722de5191
83
docs/infrastructure/github-actions/latex.md
Normal file
83
docs/infrastructure/github-actions/latex.md
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
---
|
||||||
|
tags:
|
||||||
|
- LaTeX
|
||||||
|
- Github Actions
|
||||||
|
- CD
|
||||||
|
- Pipeline
|
||||||
|
- Tectonic
|
||||||
|
---
|
||||||
|
|
||||||
|
# Building LaTeX in Github Actions
|
||||||
|
|
||||||
|
This pipeline uses [tectonic](https://tectonic-typesetting.github.io) as the build system for LaTeX. Covered here are:
|
||||||
|
|
||||||
|
- Custom fonts
|
||||||
|
- Pipeline
|
||||||
|
- Upload generated files as artifacts
|
||||||
|
|
||||||
|
## Fonts
|
||||||
|
|
||||||
|
If we are using custom fonts, we need to make them available first. This means checking them into the repo (or downloading them remotely). In this case I chose storing them as LFS files.
|
||||||
|
|
||||||
|
In most Linux systems you can install custom fonts under `~/.fonts`.
|
||||||
|
|
||||||
|
```
|
||||||
|
./fonts/
|
||||||
|
├── Open_Sans.zip
|
||||||
|
├── Roboto_Mono.zip
|
||||||
|
└── install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
TARGET=~/.fonts
|
||||||
|
mkdir -p $TARGET
|
||||||
|
unzip -o -d "$TARGET/roboto_mono" "./fonts/Roboto_Mono.zip"
|
||||||
|
unzip -o -d "$TARGET/open_sans" "./fonts/Open_Sans.zip"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Pipeline
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: 'Build LaTeX'
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Optional Cache of downloaded Tex packages
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
name: Tectonic Cache
|
||||||
|
with:
|
||||||
|
path: ~/.cache/Tectonic
|
||||||
|
key: ${{ runner.os }}-tectonic-${{ hashFiles('**/*.tex') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-tectonic-
|
||||||
|
|
||||||
|
# Install tectonic
|
||||||
|
- uses: wtfjoke/setup-tectonic@v2
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Install fonts
|
||||||
|
run: ./fonts/install.sh
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: tectonic src/main.tex
|
||||||
|
|
||||||
|
- name: Upload PDFs
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: PDFs
|
||||||
|
path: '*.pdf'
|
||||||
|
```
|
@ -40,6 +40,9 @@ const config = {
|
|||||||
themeConfig:
|
themeConfig:
|
||||||
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
|
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
|
||||||
({
|
({
|
||||||
|
colorMode: {
|
||||||
|
respectPrefersColorScheme: true,
|
||||||
|
},
|
||||||
navbar: {
|
navbar: {
|
||||||
title: 'Memoir',
|
title: 'Memoir',
|
||||||
items: [
|
items: [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const sidebars = {
|
const sidebars = {
|
||||||
tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }],
|
main: [{ type: 'autogenerated', dirName: '.' }],
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = sidebars
|
module.exports = sidebars
|
||||||
|
Loading…
Reference in New Issue
Block a user