Skip to content

Commit 6a502c8

Browse files
Update main.yml
1 parent 8605845 commit 6a502c8

File tree

1 file changed

+87
-15
lines changed

1 file changed

+87
-15
lines changed

.github/workflows/main.yml

Lines changed: 87 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,97 @@
1-
name: Generate Datas
1+
name: GitHub Snake Game
2+
3+
24

35
on:
4-
schedule: # execute every 12 hours
5-
- cron: "* */12 * * *"
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+
617
workflow_dispatch:
718

19+
20+
21+
# Trigger the workflow on pushes to the main branch
22+
23+
push:
24+
25+
branches:
26+
27+
- main
28+
29+
30+
831
jobs:
9-
build:
10-
name: Jobs to update datas
32+
33+
generate:
34+
1135
runs-on: ubuntu-latest
36+
37+
timeout-minutes: 10
38+
39+
40+
1241
steps:
13-
# Snake Animation
14-
- uses: Platane/snk@master
15-
id: snake-gif
16-
with:
17-
github_user_name: {{ThecoderPinar}}
18-
svg_out_path: dist/github-contribution-grid-snake.svg
1942

20-
- uses: crazy-max/ghaction-github-pages@v2.1.3
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+
2157
with:
22-
target_branch: output
23-
build_dir: dist
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+
2475
env:
25-
GITHUB_TOKEN: ${{ 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 }}
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]"

0 commit comments

Comments
 (0)