-
Notifications
You must be signed in to change notification settings - Fork 1.3k
44 lines (38 loc) · 1.55 KB
/
calibreapp-image-actions.yml
File metadata and controls
44 lines (38 loc) · 1.55 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
# Compress images on demand (workflow_dispatch), and at 12am every Sunday (schedule).
# Open a Pull Request if any images can be compressed.
name: Compress Images
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
permissions: {}
jobs:
build:
# As this action runs on a schedule, only run it in the FreeTubeApp/FreeTube repository to avoid unnecessary GitHub Actions usage/billing in forks.
# Still allow the workflow to be manually triggered.
# If a fork does need this workflow, they can change this condition in their fork to include their repository.
if: github.repository == 'FreeTubeApp/FreeTube' || github.event_name == 'workflow_dispatch'
name: calibreapp/image-actions
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
with:
persist-credentials: false
- name: Compress Images
id: calibre
uses: calibreapp/image-actions@d9c8ee5c3dc52ae4622c82ead88d658f4b16b65f
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
compressOnly: true
- name: Create New Pull Request If Needed
if: steps.calibre.outputs.markdown != ''
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 #v8.1.0
with:
title: Compressed Images Nightly
branch-suffix: timestamp
commit-message: Compressed Images
body: ${{ steps.calibre.outputs.markdown }}