-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (29 loc) · 1006 Bytes
/
generate-gif.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
name: Create Animated GIF
on: push
jobs:
create-gif:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install ImageMagick
run: sudo apt-get install imagemagick
- name: Create GIF from images
run: convert -delay 100 -loop 0 *.png animated.gif
- name: Commit and push changes
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs');
const path = 'animated.gif';
const message = 'Add animated GIF';
const content = fs.readFileSync(path, 'base64');
await github.repos.createOrUpdateFileContents({
owner: context.repo.owner,
repo: context.repo.repo,
path: path,
message: message,
content: content,
branch: context.ref.replace('refs/heads/', '')
});