Delete pdf/0.pdf #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extract the coverpages from the pdfs in ./pdf, as images, save then in ./img, so that we can use them as thumbnails in the gallery in 'index.html'. | |
name: extract_coverpages | |
on: | |
push: | |
paths: | |
- 'pdf/[0-9]*.pdf' | |
jobs: | |
extract-coverpages-and-add-to-gallery: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout project" | |
uses: actions/checkout@v4 | |
- name: "Set up Python" | |
uses: actions/setup-python@v5 | |
- name: "Install dependencies" | |
run: | | |
echo "Installing and upgrading pip..." | |
python -m pip install --upgrade pip | |
echo "installing poppler" | |
sudo apt-get install poppler-utils | |
echo "Installing pdf2image..." | |
pip install pdf2image # For extracting coverpages | |
- name: "Extract coverpages run python script" | |
run: | | |
python3 extract-thumbnails.py | |
echo "Updating index.html with new images." | |
python3 generate-index.py | |
- name: "Commit changes" | |
run: | | |
git config --local user.email "y@example.com" | |
git config --local user.name "GitHub Action" | |
git add img index.html | |
git commit -m "[CI/CD] Added new thumbnail to gallery" | |
git push |