Skip to content

Create/publish thumbnails #49

Create/publish thumbnails

Create/publish thumbnails #49

Workflow file for this run

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: pozetroninc/github-action-get-latest-release@v0.8.0
id: cv_release
with:
#token: ${{ secrets.GITHUB_TOKEN }}
repository: "maxpowis/cv"
- 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-maxpowis-${{ steps.cv_release.outputs.release }}.pdf
- name: Install Poppler Utils
run: sudo apt-get install -y poppler-utils
- name: Convert pdf to png
run: pdftoppm -png -scale-to-x 124 -scale-to-y 175 cv-maxpowis-${{ steps.cv_release.outputs.release }}.pdf cv
- 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.API_TOKEN_GITHUB }}
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-maxpowis-${{ steps.cv_release.outputs.release }}.pdf thumbnails'