Skip to content

Commit

Permalink
Merge pull request #17 from tijdschriftdefilosoof/break-out-workflows
Browse files Browse the repository at this point in the history
Breakout the GitHub Actions workflow in run-gen-index.yml to three ne…
  • Loading branch information
PSJ-Sokolov authored Mar 18, 2024
2 parents 9cade18 + 5e71e4a commit e8b0025
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 30 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/extract-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
echo "Installing and upgrading pip..."
python -m pip install --upgrade pip
echo "Installing pdf2image..."
pip install pdf2image # For extracting coverpages

- name: Extract coverpages run python script
run: python3 extract-humbnails.py

- name: Commit and push changes
run: |
git config --local user.email "
git config --local user.name "GitHub Action"
git add img
git commit -m "[CI/CD] Extract coverpages"
git push
30 changes: 30 additions & 0 deletions .github/workflows/regenerate-gallery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Deze file zou de `index.html` aan moeten passen, als de nieuwe thumbnails geextraheerd zijn.

on:
push:
paths:
- 'img/[0-9]*.png'

jobs:
add-new-thumbnails-to-gallery:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Update index.html with new images.
run: |
echo "Updating index.html with new images."
python3 generate-index.py
- name: Commit changes
run: |
git config --local user.email "
git config --local user.name "GitHub Action"
git add index.html
git commit -m "[CI/CD] Update index.html with new images"
git push
31 changes: 31 additions & 0 deletions .github/workflows/regnerate-index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Deze action zou moeten draaien als de template.html wordt aangepast, zodat de nieuwe info er komt te staan.
name: Update from 'template.html'

on:
push:
paths:
- 'template.html'

jobs:
update-index-html-from-template-html:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Update index.html from new template.html
run: |
echo "Updating index.html from new template.html"
python3 generate-index.py
- name: Commit changes
run: |
git config --local user.email "
git config --local user.name "GitHub Action"
git add index.html
git commit -m "[CI/CD] Update index.html from new template.html"
git push
30 changes: 0 additions & 30 deletions .github/workflows/run-gen-index-img.yml

This file was deleted.

0 comments on commit e8b0025

Please sign in to comment.