Skip to content

Commit b6cae47

Browse files
authored
Update snake_gif.yml
1 parent 7ce821d commit b6cae47

File tree

1 file changed

+37
-22
lines changed

1 file changed

+37
-22
lines changed

.github/workflows/snake_gif.yml

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,53 @@
1-
name: generate animation
1+
# GitHub Action for generating a contribution graph with a snake eating your contributions.
2+
3+
name: Generate Snake
4+
5+
# Controls when the action will run. This action runs every 6 hours.
26

37
on:
4-
# run automatically every 6 hours
58
schedule:
6-
- cron: "0 */6 * * *"
7-
8-
# allows to manually run the job at any time
9+
# every 6 hours
10+
- cron: "0 */6 * * *"
11+
12+
# This command allows us to run the Action automatically from the Actions tab.
913
workflow_dispatch:
10-
11-
# run on every push on the master branch
12-
push:
13-
branches:
14-
- master
15-
16-
1714

15+
# The sequence of runs in this workflow:
1816
jobs:
19-
generate:
17+
# This workflow contains a single job called "build"
18+
build:
19+
# The type of runner that the job will run on
2020
runs-on: ubuntu-latest
21-
timeout-minutes: 10
2221

22+
# Steps represent a sequence of tasks that will be executed as part of the job
2323
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@master
24+
25+
# Checks repo under $GITHUB_WORKSHOP, so your job can access it
26+
- uses: actions/checkout@v2
27+
28+
# Generates the snake
29+
- uses: Platane/snk@master
30+
id: snake-gif
2731
with:
28-
github_user_name: ${{ github.repository_owner }}
32+
github_user_name: arayofcode
33+
# these next 2 lines generate the files on a branch called "output". This keeps the main branch from cluttering up.
34+
gif_out_path: dist/github-contribution-grid-snake.gif
2935
svg_out_path: dist/github-contribution-grid-snake.svg
3036

31-
# push the content of <build_dir> to a branch
32-
# the content will be available at https://raw.githubusercontent.com/<github_user>/<repository>/<target_branch>/<file> , or as github page
33-
- name: push github-contribution-grid-snake.svg to the output branch
34-
uses: crazy-max/ghaction-github-pages@v2.5.0
37+
# show the status of the build. Makes it easier for debugging (if there's any issues).
38+
- run: git status
39+
40+
# Push the changes
41+
- name: Push changes
42+
uses: ad-m/github-push-action@master
43+
with:
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
branch: master
46+
force: true
47+
48+
- uses: crazy-max/ghaction-github-pages@v2.1.3
3549
with:
50+
# the output branch we mentioned above
3651
target_branch: output
3752
build_dir: dist
3853
env:

0 commit comments

Comments
 (0)