Generate Contribution Snake Animation #70
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 Contribution Snake Animation | |
on: | |
schedule: | |
- cron: "0 */24 * * *" # Run every 24 hours | |
workflow_dispatch: # Allow manual trigger | |
push: | |
branches: | |
- master | |
jobs: | |
generate: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 # Increased timeout for larger repositories | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches and tags | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Generate contribution snake animation | |
uses: Platane/snk/svg-only@v3 | |
with: | |
github_user_name: ${{ github.repository_owner }} | |
outputs: | | |
dist/github-contribution-grid-snake.svg | |
dist/github-contribution-grid-snake-dark.svg?palette=github-dark | |
- name: Push generated files to output branch | |
uses: crazy-max/[email protected] | |
with: | |
target_branch: output | |
build_dir: dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run security scan | |
uses: github/codeql-action/analyze@v2 | |
with: | |
languages: javascript | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.OS }}-node- |