Skip to content

Add two more dances #36

Add two more dances

Add two more dances #36

Workflow file for this run

# TODO: create custom action or use the actions listed here to install necessary latex packages:
# https://stackoverflow.com/questions/59269850/caching-apt-packages-in-github-actions-workflow/73500415#73500415
name: Create Dance Cards
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
compile-full:
name: Compile the full cards
runs-on: ubuntu-20.04
steps:
# repository now lies in $GITHUB_WORKSPACE
- uses: actions/checkout@v3
- name: LaTeX compilation full pdf
uses: dante-ev/latex-action@2021-A
with:
root_file: cards.tex
working_directory: .
compiler: latexmk
- name: Archive full pdf
uses: actions/upload-artifact@v3
with:
name: full-pdf
path: cards.pdf
compile-single:
name: Compile the single cards
runs-on: ubuntu-20.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Install python dependencies
run: pip install -r requirements.txt
- name: Run split script
run: python3 split.py
- name: LaTeX compilation single pdfs
uses: dante-ev/latex-action@2021-A
with:
# left empty so all tex files are compiled
root_file: ""
working_directory: split
compiler: latexmk
# copy those to a separate directory to archive them
- run: mkdir -p single
- name: Copy split pdfs
run: cp split/*.pdf single/
# TODO: rename pdf files to german names
- name: Archive split pdfs
uses: actions/upload-artifact@v3
with:
name: single-pdfs
path: single/
compile-multipage:
name: Compile the multipage versions.
runs-on: ubuntu-20.04
needs: [compile-full, compile-single]
steps:
- uses: actions/checkout@v3
- name: Install python dependencies
run: pip install -r requirements.txt
# get the compiled pdfs
- uses: actions/download-artifact@v3
with:
name: single-pdfs
path: single/
- uses: actions/download-artifact@v3
with:
name: full-pdf
#- run: ls -la .
#- run: ls -la single
- name: Create multipage tex file 2x2
run: python multi.py --single_pdfs single/ --full_pdf cards.pdf --nup_factor 2 --fold_edge short --output_tex cards_2x2_short.tex
- name: Create multipage tex file 2x2
run: python multi.py --single_pdfs single/ --full_pdf cards.pdf --nup_factor 2 --fold_edge long --output_tex cards_2x2_long.tex
- name: Create multipage tex file 3x3
run: python multi.py --single_pdfs single/ --full_pdf cards.pdf --nup_factor 3 --fold_edge short --output_tex cards_3x3_short.tex
- name: Create multipage tex file 3x3
run: python multi.py --single_pdfs single/ --full_pdf cards.pdf --nup_factor 3 --fold_edge long --output_tex cards_3x3_long.tex
- name: Create multipage tex file 4x4
run: python multi.py --single_pdfs single/ --full_pdf cards.pdf --nup_factor 4 --fold_edge short --output_tex cards_4x4_short.tex
- name: Create multipage tex file 4x4
run: python multi.py --single_pdfs single/ --full_pdf cards.pdf --nup_factor 4 --fold_edge long --output_tex cards_4x4_long.tex
- name: Compile multipage 2x2 short edge
uses: dante-ev/latex-action@2021-A
with:
root_file: cards_2x2_short.tex
working_directory: .
- name: Compile multipage 2x2 long edge
uses: dante-ev/latex-action@2021-A
with:
root_file: cards_2x2_long.tex
working_directory: .
- name: Compile multipage 3x3 short edge
uses: dante-ev/latex-action@2021-A
with:
root_file: cards_3x3_short.tex
working_directory: .
- name: Compile multipage 3x3 long edge
uses: dante-ev/latex-action@2021-A
with:
root_file: cards_3x3_long.tex
working_directory: .
- name: Compile multipage 4x4 short edge
uses: dante-ev/latex-action@2021-A
with:
root_file: cards_4x4_short.tex
working_directory: .
- name: Compile multipage 4x4 long edge
uses: dante-ev/latex-action@2021-A
with:
root_file: cards_4x4_long.tex
working_directory: .
- name: Archive multipage pdf 2x2 short edge
uses: actions/upload-artifact@v3
with:
name: cards-2x2-shortedge-pdf
path: cards_2x2_short.pdf
- name: Archive multipage pdf 2x2 long edge
uses: actions/upload-artifact@v3
with:
name: cards-2x2-longedge-pdf
path: cards_2x2_long.pdf
- name: Archive multipage pdf 3x3 short edge
uses: actions/upload-artifact@v3
with:
name: cards-3x3-shortedge-pdf
path: cards_3x3_short.pdf
- name: Archive multipage pdf 3x3 long edge
uses: actions/upload-artifact@v3
with:
name: cards-3x3-longedge-pdf
path: cards_3x3_long.pdf
- name: Archive multipage pdf 4x4 short edge
uses: actions/upload-artifact@v3
with:
name: cards-4x4-shortedge-pdf
path: cards_4x4_short.pdf
- name: Archive multipage pdf 4x4 long edge
uses: actions/upload-artifact@v3
with:
name: cards-4x4-longedge-pdf
path: cards_4x4_long.pdf