Skip to content

refactor: Move deploy to its own deploy job #1

refactor: Move deploy to its own deploy job

refactor: Move deploy to its own deploy job #1

Workflow file for this run

name: Build
on:
workflow_call:
push:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build-english:
runs-on: ubuntu-22.04
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Setup Python3
uses: actions/setup-python@v2
with:
python-version: 3.12.1
- name: Install pip dependencies
run: |
python -m pip install -r requirements.txt
- name: Create build and output folder
working-directory: ./english
run: |
mkdir -p build output
- name: Upload data as artifact
uses: actions/upload-artifact@v4
with:
name: english-data
path: english/data
- name: Create format files with Python
working-directory: ./english
run: |
python format.py oxford_3000
python format.py oxford_5000
python format.py oxford_5000_exclusive
- name: Upload html as artifact
uses: actions/upload-artifact@v4
with:
name: english-output-html
path: english/output/*.html
- name: Install wkthtmltopdf
run: |
sudo apt-get update && sudo apt-get install -y wkhtmltopdf
- name: Convert html to pdf with wkhtmltopdf
working-directory: ./english
run: |
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_alphabetical.html output/oxford_3000_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_by_cefr_shuffle.html output/oxford_3000_by_cefr_shuffle.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_underscore_alphabetical.html output/oxford_3000_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_underscore_by_cefr.html output/oxford_3000_underscore_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_by_cefr.html output/oxford_3000_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_alphabetical.html output/oxford_5000_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_by_cefr.html output/oxford_5000_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_by_cefr_shuffle.html output/oxford_5000_by_cefr_shuffle.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_underscore_alphabetical.html output/oxford_5000_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_underscore_by_cefr.html output/oxford_5000_underscore_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_alphabetical.html output/oxford_5000_exclusive_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_by_cefr.html output/oxford_5000_exclusive_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_by_cefr_shuffle.html output/oxford_5000_exclusive_by_cefr_shuffle.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_underscore_alphabetical.html output/oxford_5000_exclusive_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_underscore_by_cefr.html output/oxford_5000_exclusive_underscore_by_cefr.pdf
- name: Upload html-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: english-output-pdf-from-html
path: english/output/*.pdf
- name: Create pdf with Latex
uses: xu-cheng/latex-action@v3
with:
working_directory: english/format
latexmk_use_xelatex: true
root_file: |
*.tex
- name: Upload tex-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: english-output-pdf-from-tex
path: english/format/*.pdf
build-spanish:
runs-on: ubuntu-22.04
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Setup Python3
uses: actions/setup-python@v2
with:
python-version: 3.12.1
- name: Install pip dependencies
run: |
python -m pip install -r requirements.txt
- name: Create build and output folder
working-directory: ./spanish
run: |
mkdir -p build output
- name: Upload data as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-data
path: spanish/data
- name: Create format files with Python
working-directory: ./spanish
run: |
python format.py spanish_3000
python format.py spanish_5000
- name: Upload html as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-output-html
path: spanish/output/*.html
- name: Install wkthtmltopdf
run: |
sudo apt-get update && sudo apt-get install -y wkhtmltopdf
- name: Convert html to pdf with wkhtmltopdf
working-directory: ./spanish
run: |
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_alphabetical.html output/spanish_3000_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_shuffled.html output/spanish_3000_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_underscore_alphabetical.html output/spanish_3000_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_underscore_by_cefr_alphabetical.html output/spanish_3000_underscore_by_cefr_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_underscore_by_cefr_shuffled.html output/spanish_3000_underscore_by_cefr_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_underscore_shuffled.html output/spanish_3000_underscore_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_alphabetical.html output/spanish_5000_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_shuffled.html output/spanish_5000_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_underscore_alphabetical.html output/spanish_5000_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_underscore_by_cefr_alphabetical.html output/spanish_5000_underscore_by_cefr_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_underscore_by_cefr_shuffled.html output/spanish_5000_underscore_by_cefr_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_underscore_shuffled.html output/spanish_5000_underscore_shuffled.pdf
- name: Upload html-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-output-pdf-from-html
path: spanish/output/*.pdf
- name: Create pdf with Latex
uses: xu-cheng/latex-action@v3
with:
working_directory: spanish/format
latexmk_use_xelatex: true
root_file: |
*.tex
- name: Upload tex-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-output-pdf-from-tex
path: spanish/format/*.pdf