Skip to content

Commit cc69a78

Browse files
authored
Create main.yml
1 parent 54fabda commit cc69a78

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/main.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# GitHub Action for generating a contribution graph with a snake eating your contributions.
2+
name: Generate Snake
3+
4+
# Controls when the action will run.
5+
on:
6+
schedule:
7+
# every 12 hours
8+
- cron: "0 */12 * * *"
9+
10+
# This command allows us to run the Action automatically from the Actions tab.
11+
workflow_dispatch:
12+
13+
# Also run on every push on the master branch
14+
push:
15+
branches:
16+
- main
17+
18+
# The sequence of runs in this workflow:
19+
jobs:
20+
# This workflow contains a single job called "build"
21+
build:
22+
# The type of runner that the job will run on
23+
runs-on: ubuntu-latest
24+
25+
# Steps represent a sequence of tasks that will be executed as part of the job
26+
steps:
27+
- name: Clone repo
28+
uses: actions/checkout@v3
29+
30+
- name: Generate the snake files in './dist/'
31+
uses: Platane/snk@v3
32+
id: snake-gif
33+
with:
34+
github_user_name: ${{ github.repository_owner }}
35+
outputs: |
36+
dist/github-contribution-grid-snake.svg
37+
dist/github-contribution-grid-snake-dark.svg?palette=github-dark
38+
dist/github-contribution-grid-snake.gif?color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Show build status
43+
run: git status
44+
45+
- name: Push new files to the output branch
46+
uses: crazy-max/ghaction-github-pages@v3.1.0
47+
with:
48+
target_branch: output
49+
build_dir: dist
50+
commit_message: Update snake animations
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)