···11+22+# GitHub Action for generating a contribution graph with a snake eating your contributions.
33+name: Generate Snake
44+55+# Controls when the action will run.
66+on:
77+ schedule:
88+ # every 12 hours
99+ - cron: "0 */12 * * *"
1010+1111+ # This command allows us to run the Action automatically from the Actions tab.
1212+ workflow_dispatch:
1313+1414+ # Also run on every push on the main branch
1515+ push:
1616+ branches:
1717+ - main
1818+1919+permissions:
2020+ contents: write
2121+2222+# The sequence of runs in this workflow:
2323+jobs:
2424+ # This workflow contains a single job called "build"
2525+ build:
2626+ # The type of runner that the job will run on
2727+ runs-on: ubuntu-latest
2828+2929+ # Steps represent a sequence of tasks that will be executed as part of the job
3030+ steps:
3131+ - name: Clone repo
3232+ uses: actions/checkout@v3
3333+3434+ - name: Generate the snake files in './dist/'
3535+ uses: Platane/snk@v3
3636+ id: snake-gif
3737+ with:
3838+ github_user_name: ${{ github.repository_owner }}
3939+ outputs: |
4040+ dist/github-contribution-grid-snake.svg
4141+ dist/github-contribution-grid-snake-dark.svg?palette=github-dark
4242+ dist/github-contribution-grid-snake.gif?color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9
4343+ env:
4444+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4545+4646+ - name: Show build status
4747+ run: git status
4848+4949+ - name: Push new files to the output branch
5050+ uses: crazy-max/ghaction-github-pages@v3.1.0
5151+ with:
5252+ target_branch: snake
5353+ build_dir: dist
5454+ commit_message: Update snake animations at ${{ github.run_id }} · $(date -u +'%Y-%m-%dT%H:%M:%SZ')
5555+ env:
5656+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}