Skip to content

Commit 3e2c3f5

Browse files
authored
Add GitHub Actions workflow for snake animation
1 parent c138563 commit 3e2c3f5

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/snake.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Generate Snake Animation
2+
3+
on:
4+
# Run automatically every 24 hours
5+
schedule:
6+
- cron: "0 0 * * *"
7+
8+
# Allows manual trigger
9+
workflow_dispatch:
10+
11+
# Run on every push to main
12+
push:
13+
branches:
14+
- main
15+
16+
jobs:
17+
generate:
18+
permissions:
19+
contents: write
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 5
22+
23+
steps:
24+
# Checkout the repository
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
28+
# Generate the snake animation
29+
- name: Generate github-contribution-grid-snake.svg
30+
uses: Platane/snk/svg-only@v3
31+
with:
32+
github_user_name: TagSteel
33+
outputs: |
34+
dist/github-contribution-grid-snake.svg
35+
dist/github-contribution-grid-snake-dark.svg?palette=github-dark
36+
37+
# Push the generated files to the output branch
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)