-
-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (41 loc) · 1.18 KB
/
micropub-media-conversion.yml
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
name: Micropub media conversion
on:
push:
branches:
- 'main'
paths:
- 'content/images/*-original.jpeg'
jobs:
get-added-files:
runs-on: ubuntu-latest
outputs:
jpeg: ${{ steps.added-jpegs.outputs.jpeg }}
steps:
- name: checkout
uses: actions/checkout@main
with:
fetch-depth: 2
- name: Get added JPEGs
id: added-jpegs
run: echo "jpeg=$(git diff --name-only --diff-filter=ACMRT ${{ github.sha }}{^,} | grep original.jpeg$ | xargs)" > $GITHUB_OUTPUT
convert-jpegs:
needs: get-added-files
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@main
- name: use node 20
uses: actions/setup-node@v3
with:
node-version: 20.x
- run: npm ci
- name: Convert JPEGs
run: node scripts/convert-jpegs.js ${{needs.get-added-files.outputs.jpeg}}
- name: Push
run: |
date > generated.txt
git config user.name github-actions
git config user.email github-actions@github.com
git add content/images
git commit -m "Image conversions for ${{needs.get-added-files.outputs.jpeg}}" -m "[skip ci]"
git push