Create/publish thumbnails #40
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
name: Create/publish thumbnails | |
on: | |
workflow_dispatch: | |
inputs: | |
publish_flag: | |
description: Publish to website | |
type: boolean | |
default: false | |
jobs: | |
convert_png: | |
name: Create & Publish PNG | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get the latest release | |
uses: rez0n/actions-github-release@v2.0 | |
id: cv_release | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: "maxpowis/cv" | |
type: "latest" | |
- name: Echo release tag name | |
run: echo "::debug::Found tag for latest release >> ${{ steps.cv_release.outputs.release }}" | |
- name: Download cv.pdf from release | |
uses: Legion2/download-release-action@v2.1.0 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: "maxpowis/cv" | |
tag: ${{ steps.cv_release.outputs.release }} | |
file: cv.pdf | |
- name: Convert pdf to png (ImageMagick) | |
uses: jruipinto/ImageMagick-action@v1 | |
with: | |
command: convert -verbose -background white -alpha remove -alpha off -density 600 -scale 10% cv.pdf cv-%02d.png | |
- name: Move PNG's in isolated directory | |
run: mkdir --parents cv; mv *.png $_ | |
- name: Upload png artifacts to worflow | |
uses: actions/upload-artifact@v4 | |
with: | |
path: cv/*.png | |
if-no-files-found: error | |
- name: Publish png's to website | |
uses: crykn/copy_folder_to_another_repo_action@v1.0.6 | |
if: ${{ inputs.publish_flag }} | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.PERSONAL_TOKEN_REPO_WORKFLOW }} | |
with: | |
source_folder: 'cv' | |
destination_repo: 'maxpowis/maxpowis.github.io' | |
destination_folder: 'assets/img/cv' | |
user_email: 'max.powis@gmail.com' | |
user_name: 'maxpowis' | |
commit_msg: 'Update the cv.pdf thumbnails' |