Skip to content

Commit

Permalink
ci: enable automated compile of the PDF (easier to collaborate)
Browse files Browse the repository at this point in the history
  • Loading branch information
romintomasetti committed Jul 2, 2024
1 parent 612da55 commit 7b5b9c7
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 2 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build PDF

on:
push

env:
REGISTRY: ghcr.io

jobs:

set-vars:
runs-on: [ubuntu-latest]
outputs:
CI_IMAGE : ${{ steps.common.outputs.CI_IMAGE }}
steps:
- name: Export common variables.
id : common
run : |
echo "CI_IMAGE=${{ env.REGISTRY }}/${{ github.repository }}/latex" >> $GITHUB_OUTPUT
build-image:
needs: [set-vars]
runs-on: [ubuntu-latest]
container:
image: docker:latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4

- uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
file: dockerfile
tags: ${{ needs.set-vars.outputs.CI_IMAGE }}
cache-from: type=registry,ref=${{ needs.set-vars.outputs.CI_IMAGE }}
cache-to: type=inline
labels: "org.opencontainers.image.source=${{ github.repositoryUrl }}"

build-pdf:
needs: [set-vars, build-image]
runs-on: [ubuntu-latest]
container:
image: ${{ needs.set-vars.outputs.CI_IMAGE }}
steps:
- uses: actions/checkout@v4

- run: |
make
- uses: actions/upload-artifact@v4
with:
path: main.pdf
13 changes: 13 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ubuntu:24.04

RUN --mount=type=bind,source=requirements.txt,target=requirements.txt <<EOF

set -ex

apt update

apt --yes --no-install-recommends install $(grep -vE "^\s*#" requirements.txt | tr "\n" " ")

rm -rf /var/lib/apt/lists/*

EOF
3 changes: 1 addition & 2 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
%% The abstract is a short summary of the work to be presented in the
%% article.
\begin{abstract}
Trilinos is a community-developed, open source software framework that facilitates building large-scale, complex, multiscale, multiphysics engineering and scientific simulations.
Trilinos is a community-developed, open source software framework that facilitates building large-scale, complex, multiscale, multiphysics engineering and scientific problems.
Since the Trilinos framework has undergone substantial changes to support new applications and new hardware architectures,
this document is an update to ``An Overview of the Trilinos project'' by Heroux et al. (ACM Transactions on Mathematical Software, 31(3):397–423, 2005).
It describes the design of Trilinos, introduces its new organization in product areas,
Expand Down Expand Up @@ -314,7 +314,6 @@ \section{Trilinos Community}


\section{Discussion}
\label{sec:discussion}


\section{Acknowledgment}
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
make
texlive-latex-extra

0 comments on commit 7b5b9c7

Please sign in to comment.