Generate a fun snake game animation from your contributions on both Gitee and GitHub platforms!
name: Generate MultiSnake
on:
schedule:
- cron: "0 */6 * * *" # Runs every six hours
workflow_dispatch: # Allows manual launch
jobs:
generate:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# Checkout repository
- name: 📥 Checkout the repository
uses: actions/checkout@v2
# Generate Snake animation
- name: 🐍 Generate MultiSource Snake animation
uses: Zqzqsb/MultiSourceSnake@v1.0
with:
GITHUB_USER: # Your GitHub username {required}
GITEE_USER: # Your Gitee username {required}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITEE_TOKEN: # Your Gitee API access token {required}
outputs: |
dist/github-snake.svg
dist/github-snake-dark.svg?palette=github-dark
dist/ocean.gif?color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9
# Push outputs
- name: 🚀 Push GitHub Snake animation to the output branch
uses: crazy-max/ghaction-github-pages@v2.5.0
with:
target_branch: output
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
you can checkout my profile to figure out how to use this scipt.
after you put the script under .github/workflows
, you can manually run this action to test it.
For dark mode support on GitHub, use this special syntax in your README:
<picture>
<source media="(prefers-color-scheme: dark)" srcset="github-snake-dark.svg" />
<source media="(prefers-color-scheme: light)" srcset="github-snake.svg" />
<img alt="github-snake" src="github-snake.svg" />
</picture>
To set up your Gitee token, simply create an API token with minimal privileges.
A big thanks to Platane/snk for the original idea and implementation.
This project makes minor modifications to the original project.