|
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. |
| 1 | +name: generate animation |
6 | 2 |
|
7 | 3 | on:
|
| 4 | + |
8 | 5 | schedule:
|
9 |
| - # every 6 hours |
10 |
| - - cron: "0 */6 * * *" |
| 6 | + - cron: "0 */12 * * *" |
| 7 | + |
11 | 8 |
|
12 |
| -# This command allows us to run the Action automatically from the Actions tab. |
13 | 9 | workflow_dispatch:
|
| 10 | + |
| 11 | + |
| 12 | + push: |
| 13 | + branches: |
| 14 | + - main |
| 15 | + |
| 16 | + |
14 | 17 |
|
15 |
| -# The sequence of runs in this workflow: |
16 | 18 | jobs:
|
17 |
| - # This workflow contains a single job called "build" |
18 |
| - build: |
19 |
| - # The type of runner that the job will run on |
| 19 | + generate: |
20 | 20 | runs-on: ubuntu-latest
|
21 |
| - |
22 |
| - # Steps represent a sequence of tasks that will be executed as part of the job |
| 21 | + timeout-minutes: 10 |
| 22 | + |
23 | 23 | steps:
|
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 |
31 |
| - with: |
32 |
| - github_user_name: vcgithubcode |
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 |
35 |
| - svg_out_path: dist/github-contribution-grid-snake.svg |
36 |
| - |
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 |
| 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/svg-only@v3 |
43 | 27 | with:
|
44 |
| - github_token: ${{ secrets.GITHUB_TOKEN }} |
45 |
| - branch: master |
46 |
| - force: true |
| 28 | + github_user_name: ${{ github.repository_owner }} |
| 29 | + outputs: | |
| 30 | + dist/github-contribution-grid-snake.svg |
| 31 | + dist/github-contribution-grid-snake-dark.svg?palette=github-dark |
| 32 | + env: |
| 33 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 34 | + |
| 35 | + |
47 | 36 |
|
48 |
| - - uses: crazy-max/ghaction-github-pages@v3.1.0 |
| 37 | + |
| 38 | + - name: push github-contribution-grid-snake.svg to the output branch |
| 39 | + uses: crazy-max/ghaction-github-pages@v3.1.0 |
49 | 40 | with:
|
50 |
| - # the output branch we mentioned above |
51 | 41 | target_branch: output
|
52 | 42 | build_dir: dist
|
53 | 43 | env:
|
|
0 commit comments