Skip to content

Generate Snake Game from Contributions #868

Generate Snake Game from Contributions

Generate Snake Game from Contributions #868

name: Generate Snake Game from Contributions
on:
schedule:
# Runs every 12 hours
- cron: "0 */12 * * *"
workflow_dispatch:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Clone the repository
- name: Clone Repository
uses: actions/checkout@v3
# Step 2: Generate Snake Game files and output them to the 'dist' directory
- name: Generate Snake Game
uses: Platane/snk@v3
id: snake-gif
with:
github_user_name: ${{ github.repository_owner }}
outputs: |
dist/github-snake.svg
dist/github-snake-dark.svg?palette=github-dark
dist/github-snake.gif?color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Step 3: Show build status
- name: Check Build Status
run: git status
# Step 4: Push the generated files to the 'output' branch
- name: Push Snake Game to Output Branch
uses: crazy-max/ghaction-github-pages@v3.1.0
with:
target_branch: output
build_dir: dist
commit_message: Update snake animations
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}