Skip to content

Commit d3a781c

Browse files
authored
Merge pull request #2051 from hashicorp/br-assets
add image compression github action
2 parents bc09a3f + 8881767 commit d3a781c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Compress Images
2+
on:
3+
workflow_dispatch:
4+
# schedule:
5+
# - cron: '00 23 * * 0'
6+
7+
env:
8+
NODE_VERSION: '20.x'
9+
10+
jobs:
11+
build:
12+
name: Compress Images & Open PR
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
16+
- name: Compress Images
17+
id: calibre
18+
uses: calibreapp/image-actions@790ef463cba7b26ed3b1c80c1449deb72d4c0bcc # main
19+
with:
20+
githubToken: ${{ secrets.GITHUB_TOKEN }}
21+
compressOnly: true
22+
- name: Open a PR if images can be compressed
23+
if: steps.calibre.outputs.markdown != ''
24+
uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e # v6.0.2
25+
with:
26+
title: 'Compressed Image Assets'
27+
branch-suffix: timestamp
28+
commit-message: 'compressed image assets'
29+
body: ${{ steps.calibre.outputs.markdown }}

0 commit comments

Comments
 (0)