generate snake animation #72
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 0 * 3,4,5 *" # 12:00 AM, from March to May | |
- cron: "0 0 * 6,7,8 *" # 12:00 AM, from June to August | |
- cron: "0 0 * 9,10,11 *" # 12:00 AM, from September to November | |
- cron: "0 0 * 12,1,2 *" # 12:00 AM, from December to February | |
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 0 * 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 0 * 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 0 * 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 0 * 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/ghaction-github-pages@v4.1.0 | |
with: | |
build_dir: dist | |
commit_message: "👾 update sneek" | |
target_branch: snk | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |