-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (40 loc) · 1.2 KB
/
resize_images.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
42
43
44
45
46
47
48
name: Resize Preview Images
on:
workflow_dispatch:
workflow_call:
pull_request:
types: [ 'opened', 'edited', 'reopened', 'synchronize' ]
jobs:
resize_preview_images:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: refs/heads/staging
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
- name: (Python) Resize Images
run: |
python ./src/build/resize_images.py
- name: Commit Resized Images
run: |
git config pull.rebase false
git config --local user.email "[email protected]"
git config --local user.name "TitleCardMakerBot"
git add .
git diff-index --quiet HEAD || git commit -a -m "Resize Preview Images"
git pull
- run: git pull
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: refs/heads/staging