-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breakout the GitHub Actions workflow in run-gen-index.yml to three ne…
…w files The three new actions are: 1. extract-images.yml: Extract new images to be used as thumnails in the gallery, when new editions of the "filosoof" get added to the pdf directory (pdfs beginning with a number). Extract these images from the coverpages of the PDF. 2. regenerate-index.yml: Regenerate `index.html` when `template.html` gets alltered. 3. regenerate-gallery.yml: Regenerate the "galllery" that gets inserted into `index.html` when a .png file beginning with a number gets added (by another action) to the /img directory. These workflows should make updating the "filosoof" website basically automatic.
- Loading branch information
1 parent
9cade18
commit 5e71e4a
Showing
4 changed files
with
96 additions
and
30 deletions.
There are no files selected for viewing
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
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 |
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
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 |
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
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 |
This file was deleted.
Oops, something went wrong.