forked from hmemcpy/cv
-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (51 loc) · 1.97 KB
/
png.yml
File metadata and controls
53 lines (51 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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/[email protected]
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/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: "maxpowis/cv"
tag: ${{ steps.cv_release.outputs.release }}
file: cv-maxpowis-${{ steps.cv_release.outputs.release }}.pdf
- name: Setup ImageMagick
uses: mfinelli/[email protected]
- name: Convert pdf to png
run: magick convert -verbose -background white -alpha remove -alpha off -density 600 -scale 10% cv-maxpowis-${{ steps.cv_release.outputs.release }}.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/[email protected]
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: '[email protected]'
user_name: 'maxpowis'
commit_msg: 'Update the cv-maxpowis-${{ steps.cv_release.outputs.release }}.pdf thumbnails'