-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (38 loc) · 1.26 KB
/
png.yml
File metadata and controls
44 lines (38 loc) · 1.26 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
name: PNG Files
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
png-generator:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Installing ghostscript
run: |
sudo apt-get install ghostscript
sudo sed -i_bak 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
- name: Trigger GitHub pages rebuild
run: |
for file in $(find -name '*.pdf'); do
dir="${file%/*}"
filename="${file%.*}"
echo $dir
echo $filename
echo $file "$filename.png"
convert -resize 960 -density 150 $file -quality 100 "$filename.png"
done
- name: Commit files # commit the output folder
run: |
git config --local user.email "actions@github.com"
git config --local user.name "Github Actions"
git add .
git commit -m "generating .png files"
- name: Push changes # push the output folder to your repo
uses: ad-m/github-push-action@master
with:
branch: main
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true