Skip to content

Commit e312022

Browse files
Create MAIN.yml
1 parent 8738ce9 commit e312022

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

.github/workflows/MAIN.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
GitHub Action for generating a contribution graph with a snake eating your contributions.
2+
3+
4+
name: Generate Snake
5+
6+
7+
8+
9+
10+
Controls when the action will run. This action runs every 6 hours.
11+
12+
13+
on:
14+
15+
schedule:
16+
17+
# every 6 hours
18+
19+
- cron: "0 */6 * * *"
20+
21+
22+
23+
24+
25+
This command allows us to run the Action automatically from the Actions tab.
26+
27+
28+
workflow_dispatch:
29+
30+
31+
32+
33+
34+
The sequence of runs in this workflow:
35+
36+
37+
jobs:
38+
39+
# This workflow contains a single job called "build"
40+
41+
build:
42+
43+
# The type of runner that the job will run on
44+
45+
runs-on: ubuntu-latest
46+
47+
48+
49+
# Steps represent a sequence of tasks that will be executed as part of the job
50+
steps:
51+
52+
# Checks repo under $GITHUB_WORKSHOP, so your job can access it
53+
- uses: actions/checkout@v2
54+
55+
# Generates the snake
56+
- uses: Platane/snk@master
57+
id: snake-gif
58+
with:
59+
github_user_name: DSnake0
60+
# these next 2 lines generate the files on a branch called "output". This keeps the main branch from cluttering up.
61+
gif_out_path: dist/github-contribution-grid-snake.gif
62+
svg_out_path: dist/github-contribution-grid-snake.svg
63+
64+
# show the status of the build. Makes it easier for debugging (if there's any issues).
65+
- run: git status
66+
67+
# Push the changes
68+
- name: Push changes
69+
uses: ad-m/github-push-action@master
70+
with:
71+
github_token: ${{ secrets.GITHUB_TOKEN }}
72+
branch: master
73+
force: true
74+
75+
- uses: crazy-max/ghaction-github-pages@v2.1.3
76+
with:
77+
# the output branch we mentioned above
78+
target_branch: output
79+
build_dir: dist
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)