Skip to content

Commit a2a394d

Browse files
authored
Create main.yml
1 parent 27d88a3 commit a2a394d

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: generate animation
2+
3+
on:
4+
# run automatically every 24 hours
5+
schedule:
6+
- cron: "0 */24 * * *"
7+
8+
# allows to manually run the job at any time
9+
workflow_dispatch:
10+
11+
# run on every push on the master branch
12+
push:
13+
branches:
14+
- master
15+
16+
17+
18+
jobs:
19+
generate:
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 10
22+
23+
steps:
24+
# generates a snake game from a github user (<github_user_name>) contributions graph, output a svg animation at <svg_out_path>
25+
- name: generate github-contribution-grid-snake.svg
26+
uses: Platane/snk/svg-only@v3
27+
with:
28+
github_user_name: ${{ github.repository_owner }}
29+
outputs: |
30+
dist/github-contribution-grid-snake.svg
31+
dist/github-contribution-grid-snake-dark.svg?palette=github-dark
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
36+
# push the content of <build_dir> to a branch
37+
# the content will be available at https://raw.githubusercontent.com/<github_user>/<repository>/<target_branch>/<file> , or as github page
38+
- name: push github-contribution-grid-snake.svg to the output branch
39+
uses: crazy-max/ghaction-github-pages@v3.1.0
40+
with:
41+
target_branch: output
42+
build_dir: dist
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)