How to add a snake game to your Github page (2024)

Create a repository with your username . Github will tell you that

It is a ✨special ✨ repository that you can use to add a README.md to your GitHub profile. Make sure it’s public and initialize it with a README to get started.

How to add a snake game to your Github page (1)

If you like my read me style, you can find it here. The snake game is just a svg file, you can get it in README.

![Snake animation](https://raw.githubusercontent.com/{username}/{username}/output/github-contribution-grid-snake-dark.svg)

Please replace the {username} in the above link for yourself.

Go you your tab Actions in your README repository and create a New Workflow. Click the New workflow button, and last the set up workflow yourself link.

How to add a snake game to your Github page (2)

This will generate a new folder in your repository called .github/workflows and a new file inside of it called main.yml.

How to add a snake game to your Github page (3)
See Also
Snake Game

Copy the content from here to your main.yml. Nothing changed.

name: generate animation

on:
# run automatically every 24 hours
schedule:
- cron: "0 */12 * * *"

# allows to manually run the job at any time
workflow_dispatch:

# run on every push on the main branch
push:
branches:
- main

jobs:
generate:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
# generates a snake game from a github user (<github_user_name>) contributions graph, output a svg animation at <svg_out_path>
- name: generate github-contribution-grid-snake.svg
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# 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@v3.1.0
with:
target_branch: output
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Go to the Action tab, you will see the workflow named generate animation click it, and the Run Workflow.

How to add a snake game to your Github page (4)

If the workflow run successfully, you will get the svg file in the codes under the output branch, which config in the main.yml.

How to add a snake game to your Github page (5)
How to add a snake game to your Github page (2024)

FAQs

How to add a snake game to your Github page? ›

Snake is a fun game to make as it doesn't require a lot of code (less than 100 lines with all comments removed). This is a basic implementation of the snake game, but it's missing a few things intentionally and they're left as further exploration for the reader.

Is it easy to code snake? ›

Snake is a fun game to make as it doesn't require a lot of code (less than 100 lines with all comments removed). This is a basic implementation of the snake game, but it's missing a few things intentionally and they're left as further exploration for the reader.

How to use readme in GitHub? ›

If you add a README file to the root of a public repository with the same name as your username, that README will automatically appear on your profile page. You can edit your profile README with GitHub Flavored Markdown to create a personalized section on your profile.

How do I see my contribution in GitHub? ›

You can see your contributions over time by either clicking Show more activity at the bottom of your contribution activity or by clicking the year you're interested in viewing on the right side of the page.

How do I add a snake game in GitHub? ›

Compared with the Github default contributions, the snake game to the contributions is very impressive, so how can you get yours.
  1. Create repository. Create a repository with your username . ...
  2. Write the README. If you like my read me style, you can find it here. ...
  3. Create the Workflow. ...
  4. Run the Workflow. ...
  5. Check the SVG file.
Jul 31, 2023

How do I add an icon to my GitHub profile README? ›

On your repo that you want to add the icons to, create an issue. Drag and drop the icon file into the issue window. Wait for it to download, then it will give you a link. Copy and paste this link into your Readme file at the location you want the icon to appear.

How do I include private contributions on my GitHub profile? ›

In the top right corner of GitHub, click your profile photo, then click Your profile. Above the contribution calendar, click Contribution settings. Click Private contributions to show or hide private contributions on your profile.

How do I show activity graphs in GitHub? ›

Displaying Activity Overview Graph in GitHub
  1. Open your GitHub profile.
  2. Click on the "Contribution settings" button.
  3. Select the "Public activity" option to show your activity graph.
Feb 13, 2024

How do I add an action badge to README in GitHub? ›

To put a badge in your GitHub README, follow these steps:
  1. Go to a website like Shields.io and pick a badge you like.
  2. Click on the badge. You might need to change the text or color. Then, copy the Markdown code they give you.
  3. Open your README file on GitHub and paste the code where you want the badge to show up.
Mar 4, 2024

How do I enable contributors in GitHub? ›

In the search field, start typing the name of person you want to invite, then click a name in the list of matches. Click Add NAME to REPOSITORY. The user will receive an email inviting them to the repository. Once they accept your invitation, they will have collaborator access to your repository.

Top Articles
Latest Posts
Article information

Author: Moshe Kshlerin

Last Updated:

Views: 6542

Rating: 4.7 / 5 (57 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Moshe Kshlerin

Birthday: 1994-01-25

Address: Suite 609 315 Lupita Unions, Ronnieburgh, MI 62697

Phone: +2424755286529

Job: District Education Designer

Hobby: Yoga, Gunsmithing, Singing, 3D printing, Nordic skating, Soapmaking, Juggling

Introduction: My name is Moshe Kshlerin, I am a gleaming, attractive, outstanding, pleasant, delightful, outstanding, famous person who loves writing and wants to share my knowledge and understanding with you.