-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.48 KB
/
video.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: Generate Video
on:
schedule:
- cron: '0 0 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
generate-video:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v1-beta
id: setup-ffmpeg
- name: Generate Video
run: ffmpeg -y -framerate 10 -pattern_type glob -i "images/*.jpg" -c:v libx264 -crf 0 ./videos/video.mp4
- name: Generate Gif
run: ffmpeg -y -i ./videos/video.mp4 -vf scale=800:-1 -r 10 ./gif/animation.gif
# - name: Generate HD Gif
# run: ffmpeg -y -i ./videos/video.mp4 -vf scale=2304:-1 -r 10 ./gif/animation-HD.gif
- name: Check to see if a new video file has been created
id: changes
run: |
git add -N .
echo "::set-output name=count::$(git diff --name-only | wc -l)"
- name: Commit files
run: |
rm -rf ./videos/video.mp4
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add ./gif/animation.gif
git commit -m "Video Generated, Automated" -a
if: steps.changes.outputs.count > 0
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
if: steps.changes.outputs.count > 0