generate snake animation #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: generate snake animation | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 */12 * * *" # every 12 hours | |
jobs: | |
generate: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Set current month as environment variable | |
run: echo "MONTH=$(date +'%m')" >> $GITHUB_ENV | |
# winter theme | |
- name: generate github-contribution-grid-snake.svg | |
if: github.event.schedule == '0 */12 * 12,1,2 *' || ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && contains('12 01 02', env.MONTH)) | |
uses: Platane/snk/svg-only@v3 | |
with: | |
github_user_name: ${{ github.repository_owner }} | |
outputs: | | |
dist/github-contribution-grid-snake.svg?color_snake=#66ec48&color_dots=#a3c4d4,#b3e5fc,#4fc3f7,#039be5,#01579b | |
dist/github-contribution-grid-snake-dark.svg?color_snake=#66ec48&color_dots=#27363d,#b3e5fc,#4fc3f7,#039be5,#01579b | |
# spring theme | |
- name: generate github-contribution-grid-snake.svg | |
if: github.event.schedule == '0 */12 * 3,4,5 *' || ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && contains('03 04 05', env.MONTH)) | |
uses: Platane/snk/svg-only@v3 | |
with: | |
github_user_name: ${{ github.repository_owner }} | |
outputs: | | |
dist/github-contribution-grid-snake.svg?color_snake=#66ec48&color_dots=#a3c4d4,#f8bbd0,#f06292,#e91e63,#880e4f | |
dist/github-contribution-grid-snake-dark.svg?color_snake=#66ec48&color_dots=#27363d,#f8bbd0,#f06292,#e91e63,#880e4f | |
# summer theme | |
- name: generate github-contribution-grid-snake.svg | |
if: github.event.schedule == '0 */12 * 6,7,8 *' || ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && contains('06 07 08', env.MONTH)) | |
uses: Platane/snk/svg-only@v3 | |
with: | |
github_user_name: ${{ github.repository_owner }} | |
outputs: | | |
dist/github-contribution-grid-snake.svg?color_snake=#66ec48&color_dots=#a3c4d4,#ffecb3,#ffd54f,#ffb300,#ff6f00 | |
dist/github-contribution-grid-snake-dark.svg?color_snake=#66ec48&color_dots=#27363d,#ffecb3,#ffd54f,#ffb300,#ff6f00 | |
# autumn theme | |
- name: generate github-contribution-grid-snake.svg | |
if: github.event.schedule == '0 */12 * 9,10,11 *' || ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && contains('09 10 11', env.MONTH)) | |
uses: Platane/snk/svg-only@v3 | |
with: | |
github_user_name: ${{ github.repository_owner }} | |
outputs: | | |
dist/github-contribution-grid-snake.svg?color_snake=#66ec48&color_dots=#a3c4d4,#fdf156,#ff6f01,#fd2f24,#811d5e | |
dist/github-contribution-grid-snake-dark.svg?color_snake=#66ec48&color_dots=#27363d,#fdf156,#ff6f01,#fd2f24,#811d5e | |
# push the content of <build_dir> to a branch | |
# the content will be available at https://raw.githubusercontent.com/<github_user>/<repository>/<target_branch>/<file> , or as github page | |
- name: push github-contribution-grid-snake.svg to the output branch | |
uses: crazy-max/[email protected] | |
with: | |
build_dir: dist | |
commit_message: "👾 update sneek" | |
target_branch: snk | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |