Skip to content

Commit 9334321

Browse files
Create snake.yml
1 parent f18c0bb commit 9334321

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

.github/workflows/snake.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: GitHub Snake Game
2+
3+
4+
5+
on:
6+
7+
# Schedule the workflow to run daily at midnight UTC
8+
9+
schedule:
10+
11+
- cron: "0 0 * * *"
12+
13+
14+
15+
# Allow manual triggering of the workflow
16+
17+
workflow_dispatch:
18+
19+
20+
21+
# Trigger the workflow on pushes to the main branch
22+
23+
push:
24+
25+
branches:
26+
27+
- main
28+
29+
30+
31+
jobs:
32+
33+
generate:
34+
35+
runs-on: ubuntu-latest
36+
37+
timeout-minutes: 10
38+
39+
40+
41+
steps:
42+
43+
# Step 1: Checkout the repository
44+
45+
- name: Checkout Repository
46+
47+
uses: actions/checkout@v3
48+
49+
50+
51+
# Step 2: Generate the snake animations
52+
53+
- name: Generate GitHub Contributions Snake Animations
54+
55+
uses: Platane/snk@v3
56+
57+
with:
58+
59+
# GitHub username to generate the animation for
60+
61+
github_user_name: ${{ github.repository_owner }}
62+
63+
64+
65+
# Define the output files and their configurations
66+
67+
outputs: |
68+
69+
dist/github-snake.svg
70+
71+
dist/github-snake-dark.svg?palette=github-dark
72+
73+
dist/ocean.gif?color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9
74+
75+
env:
76+
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
79+
80+
81+
# Step 3: Deploy the generated files to the 'output' branch
82+
83+
- name: Deploy to Output Branch
84+
85+
uses: peaceiris/actions-gh-pages@v3
86+
87+
with:
88+
89+
github_token: ${{ secrets.GITHUB_TOKEN }}
90+
91+
publish_dir: ./dist
92+
93+
publish_branch: output
94+
95+
# Optionally, you can set a custom commit message
96+
97+
commit_message: "Update snake animation [skip ci]"
98+

0 commit comments

Comments
 (0)