๊ธฐ๋ก๋ฐฉ

๐ŸŒฑ Github 3D ์ž”๋”” ๊พธ๋ฏธ๊ธฐ ๋ณธ๋ฌธ

Tips

๐ŸŒฑ Github 3D ์ž”๋”” ๊พธ๋ฏธ๊ธฐ

Soom_1n 2024. 2. 21. 10:30
๐Ÿ’ก ๋‹ค์Œ ์‚ฌ์ง„์ฒ˜๋Ÿผ github ํ”„๋กœํ•„์— 3D ์ž”๋””๋ฅผ ๋งŒ๋“ค์–ด๋ณด์ž!

 


 

๋‹ค์Œ ํฌ์ŠคํŒ…์„ ์ฐธ๊ณ ํ–ˆ๋‹ค. GIF๊นŒ์ง€ ๋งŒ๋“ค์–ด๋‘์‹  ์ •์„ฑ์— ์•„์ฃผ ์‰ฝ๊ฒŒ ๋”ฐ๋ผ ํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค.
๋‹จ, github action์„ run ํ•˜๋Š” ๋ถ€๋ถ„์—์„œ ์˜ค๋ฅ˜๊ฐ€ ๋‚ฌ๋Š”๋ฐ, ๊ทธ ๋ถ€๋ถ„์— ๋Œ€ํ•œ ์ˆ˜์ • ์‚ฌํ•ญ์„ ์ถ”๊ฐ€๋กœ ์ž‘์„ฑํ•œ๋‹ค.

 

 

3D์ž”๋””๋Š” yoshi389111์˜ github-profile-3d-contrib ํ”„๋กœ์ ํŠธ๋กœ ๊นƒํ—™์— ๊ณต์œ ๋˜๊ณ  ์žˆ๋‹ค.

https://github.com/yoshi389111/github-profile-3d-contrib#step-4-add-image-to-readmemd

 

GitHub - yoshi389111/github-profile-3d-contrib: This GitHub Action creates a GitHub contribution calendar on a 3D profile image.

This GitHub Action creates a GitHub contribution calendar on a 3D profile image. - yoshi389111/github-profile-3d-contrib

github.com

 

Github Action์„ ํ†ตํ•ด ๊ณต๊ฐœ ๋œ ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋ฅผ ๋ถ„์„ํ•˜๊ณ  ์ปค๋ฐ‹๊ณผ ์–ธ์–ด ํผ์„ผํŠธ๋ฅผ 3D๋กœ ๋ณด์—ฌ์ฃผ๋Š” ๋ฐฉ์‹์ด๋‹ค.

ํ•ด๋‹น ์ •๋ณด๋ฅผ SVG๋กœ ๋ณ€ํ™˜ํ•ด ๋ฐ˜ํ™˜ํ•˜๋ฉด, ๊นƒํ—™ ํ”„๋กœํ•„ README์— ๋„์šฐ๋Š” ๋ฐฉ์‹์ด๋‹ค.

 

๋‹ค์Œ ์ด์–ด์งˆ ์ ์šฉ ๋ฐฉ๋ฒ•์€ ์œ„์˜ ํ”„๋กœ์ ํŠธ README์— ์ž‘์„ฑ๋˜์–ด ์žˆ๋‹ค.


1. ๋ ˆํฌ์ง€ํ† ๋ฆฌ ์ƒ์„ฑ

๋ณธ์ธ์˜ ๊นƒํ—ˆ๋ธŒ ๋‹‰๋„ค์ž„๊ณผ ์ •ํ™•ํžˆ ์ผ์น˜ํ•œ ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.

public์œผ๋กœ ์ƒ์„ฑํ•˜๊ณ  README๋ฅผ ์ถ”๊ฐ€ํ•ด ๋‘์ž.

 

๋ ˆํฌ์ง€ํ† ๋ฆฌ๋ฅผ ๋งŒ๋“ค๊ณ  ๋“ค์–ด๊ฐ€๋ฉด, ํ•ด๋‹น ์ €์žฅ์†Œ๋ฅผ ํ”„๋กœํ•„์— ๋ณด์ด๊ฒŒ ํ•˜๋Š” ํŠน๋ณ„ํ•œ ์ €์žฅ์†Œ๋กœ ๋“ฑ๋กํ•  ๊ฒƒ์ธ์ง€ ๋‚˜์˜จ๋‹ค.

๋“ฑ๋กํ•˜๋ฉด README๊ฐ€ ํ”„๋กœํ•„ ์ตœ์ƒ๋‹จ์— ๋ณด์ด๊ฒŒ ๋œ๋‹ค. ์šฐ๋ฆฌ๋Š” ์—ฌ๊ธฐ์— 3D ์ž”๋””๋ฅผ ๋ณด์ด๊ฑฐ๋‚˜ ๊พธ๋ฏธ๋ฉด ๋œ๋‹ค.


2. ํ† ํฐ ์ค€๋น„

์ €์žฅ์†Œ๊ฐ€ ์•„๋‹Œ ํ”„๋กœํ•„์˜ Settings > Developer settings > Personal access tokens > Tokens (classic) > Generate new tokens > Generate new Token

๊ธฐ์กด ํด๋ž˜์‹ ๋ฒ„์ „์˜ ํ† ํฐ์œผ๋กœ repo๊ถŒํ•œ๊ณผ workflow ๊ถŒํ•œ ๋“ฑ์„ ๋ถ€์—ฌํ•œ๋‹ค. ๊ธฐ๊ฐ„์€ ๋‹ค์‹œ ๊ฐฑ์‹ ํ•˜๊ธฐ ๋ฒˆ๊ฑฐ๋กœ์šฐ๋‹ˆ ๊ธฐํ•œ ์—†์Œ์„ ์„ ํƒํ–ˆ๋‹ค. (๋ณด์•ˆ์ ์œผ๋กœ๋Š” ์•ˆ ์ข‹๋‹ค๊ณ  ๊ฒฝ๊ณ ๊ฐ€ ๋œฌ๋‹ค.)

 

GIthub Action์— ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ํ† ํฐ์˜ ๊ฐ’์„ ๋ณต์‚ฌํ•ด ๋‘์ž. Action์˜ workflow์•ˆ์—์„œ README๋ฅผ ์ˆ˜์ •ํ•ด์•ผ ํ•˜๋ฏ€๋กœ ํ† ํฐ์ด ํ•„์š”ํ•œ ๊ฒƒ์ด๋‹ค.


3. ํ† ํฐ ๋“ฑ๋ก

์•„๊นŒ ๋งŒ๋“ค์—ˆ๋˜ ๊นƒํ—™ ์ด๋ฆ„ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์— ๋“ค์–ด๊ฐ€์„œ Setting > Security -> Secrets and variables > Action์— ๋“ค์–ด๊ฐ„๋‹ค.

๋ ˆํฌ์ง€ํ† ๋ฆฌ ์‹œํฌ๋ฆฟ์„ ์ƒˆ๋กœ ๋“ฑ๋กํ•˜๋Š”๋ฐ, ์•„๊นŒ ๋ณต์‚ฌํ•ด ๋‘์—ˆ๋˜ ํ† ํฐ ๊ฐ’์„ ๋„ฃ์œผ๋ฉด ๋œ๋‹ค.

ํ† ํฐ ์ด๋ฆ„์€ 'README'๋กœ ์ง€์—ˆ๋Š”๋ฐ, ๊ทธ๋ƒฅ 'TOKEN'์œผ๋กœ ์ง€์–ด๋„ ๊ดœ์ฐฎ์„ ๊ฒƒ์ด๋‹ค.

(GITHUB๋กœ ์‹œ์ž‘๋งŒ ์•ˆ ํ•˜๋ฉด ๋˜๋Š” ๊ฒƒ ๊ฐ™๋‹ค. ์˜ค๋ฅ˜๊ฐ€ ๋‚˜์„œ ์ด๊ฑฐ ์ €๊ฑฐ ํ•ด๋ณด๋‹ค๊ฐ€ ์ด๋ฆ„์ด ์ด๋ ‡๊ฒŒ ๋˜์—ˆ๋‹ค.)


4. Github Action ๋“ฑ๋ก

๊นƒํ—™ ๋‹‰๋„ค์ž„ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์˜ Actions์— ๋“ค์–ด๊ฐ„๋‹ค. ์‚ฌ์ง„์—๋Š” ์ˆ˜๋งŽ์€ ์‹œํ–‰์ฐฉ์˜ค์˜ ๊ธฐ๋ก์ด ๋ณด์ด๋Š”๋ฐ, ์ฒ˜์Œ ๋“ค์–ด๊ฐ€๋ฉด ๋น„์–ด์žˆ๋‹ค.

์ƒˆ๋กœ์šด Action์„ ๋“ฑ๋กํ•˜๊ธฐ ์œ„ํ•ด New workflow -> set up a workflow yourself๋ฅผ ํด๋ฆญํ•œ๋‹ค.

 

name: GitHub-Profile-3D-Contrib

on:
  schedule: # 03:00 JST == 18:00 UTC
    - cron: "0 18 * * *"
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    name: generate-github-profile-3d-contrib
    steps:
      - uses: actions/checkout@v3
      - uses: yoshi389111/github-profile-3d-contrib@0.7.1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          USERNAME: ${{ github.repository_owner }}
      - name: Commit & Push
        run: |
          git config user.name github-actions
          git config user.email github-actions@github.com
          git add -A .
          git commit -m "generated"
          git push

3D์ž”๋”” ํ”„๋กœ์ ํŠธ README์— ๋‚˜์˜จ ์œ„ ์Šคํฌ๋ฆฝํŠธ๋ฅผ Action์— ๋“ฑ๋กํ•ด์•ผ ํ•˜๋Š”๋ฐ, ์ˆ˜์ •ํ•  ๋ถ€๋ถ„์ด ์žˆ๋‹ค.

  • actions/checkout@v3๋Š” Github Action์—์„œ ์ œ๊ณตํ•˜๋Š” ํ”„๋กœ์ ํŠธ ๊ฒ€์ฆ ๋„๊ตฌ์ธ๋ฐ, ํ˜„์žฌ๋Š” ๋ฒ„์ „ 4๊ฐ€ ์ตœ์‹ ์ด๋‹ค.
  • GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ๋ถ€๋ถ„์—์„œ GITHUB_TOKEN์€ ์˜ค๋ฅ˜๊ฐ€ ๋‚˜๋Š” ๊ฒƒ ๊ฐ™๋‹ค.
    ์•„๊นŒ ๋งŒ๋“  ํ† ํฐ ์ด๋ฆ„์„ ์“ฐ์ž (ex. GITHUB_TOKEN: ${{ secrets.README }})

 

์ด๋ ‡๊ฒŒ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ๊ณ ์ณ์„œ run ํ•˜๋ฉด ์™„์„ฑ์ธ๋ฐ, ๋‚˜๋Š” ์˜ค๋ฅ˜๊ฐ€ ๋‚ฌ์—ˆ๋‹ค.

 

remote: Permission to Jade-Good/Jade_Good.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/Jade-Good/Jade_Good/': The requested URL returned error: 403
Error: Process completed with exit code 128.

๋ผ๋Š” ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๊ฐ€ ๋œจ๋Š”๋ฐ, ํ•ด๋‹น ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋ฅผ ์•ก์„ธ์Šค ํ•  ๊ถŒํ•œ์ด ์—†๋‹ค๋Š” ๋‚ด์šฉ์œผ๋กœ ๋ณด์ธ๋‹ค. ๋ถ„๋ช… ํ† ํฐ์„ ์ž˜ ์„ค์ •ํ–ˆ๋Š”๋ฐ ๋ญ๊ฐ€ ๋ฌธ์ œ์ผ๊นŒ ์‹ถ์–ด ์ฐพ์•„๋ณด๋‹ˆ ๋ฒ ์ด์Šค URL์„ ์„ค์ •ํ•˜๊ณ  TOKEN์„ ์ง์ ‘ push์— ๋„ฃ์–ด์ฃผ๋ผ๊ณ  ํ•˜๋Š”๋ฐ, ์‚ฌ์‹ค ์•ˆ ๋„ฃ์–ด๋„ ๊ดœ์ฐฎ์„ ๊ฒƒ ๊ฐ™๋‹ค.

 

์•„๋ฌดํŠผ ์ตœ์ข… ์Šคํฌ๋ฆฝํŠธ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž‘์„ฑํ–ˆ๋‹ค.

name: GitHub-Profile-3D-Contrib

on:
  schedule: # 03:00 JST == 18:00 UTC
    - cron: "0 18 * * *"
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    name: generate-github-profile-3d-contrib
    steps:
      - uses: actions/checkout@v4
      - uses: yoshi389111/github-profile-3d-contrib@0.7.1
        env:
          GITHUB_TOKEN: ${{ secrets.README }}
          USERNAME: ${{ github.repository_owner }}
      - name: Commit & Push
        run: |
          git config user.name Jade-Good
          git config user.email kangsm423@gmail.com
          git remote set-url origin https://github.com/Jade-Good/Jade_Good.git
          git add -A .
          git commit -m "generated"
          git push https://$GITHUB_TOKEN@github.com/Jade-Good/Jade_Good.git

์—ฌ๊ธฐ์„œ git remote set-url์„ ์ง€์ •ํ•ด ์ฃผ๊ณ , psuh์—์„œ ํ† ํฐ์„ ์ง์ ‘ ๋„ฃ์–ด์คฌ๋Š”๋ฐ, ์•ˆ ํ•ด์ค˜๋„ ๋  ๊ฒƒ ๊ฐ™๋‹ค.


5. ๊ถŒํ•œ ์„ค์ •

์œ„์— ์˜ค๋ฅ˜ํ•ด๊ฒฐ์„ ์œ„ํ•ด ์ด๊ฑฐ ์ €๊ฑฐ ์‹œ๋„ํ•ด ๋ณด์•˜๋Š”๋ฐ, ํ† ํฐ์€ ์ž˜ ๋งŒ๋“ค์–ด์กŒ๋Š”๋ฐ ๊ถŒํ•œ ์˜ค๋ฅ˜๊ฐ€ ๋œจ๋Š” ๊ฒŒ ๋ ˆํฌ์ง€ํ† ๋ฆฌ ์ž์ฒด์—์„œ ๋ง‰ํ˜€์žˆ๋Š” ๊ฒƒ ๊ฐ™๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ๋‹ค.

 

๋ ˆํฌ์ง€ํ† ๋ฆฌ์˜ Setting > Actions > General์— ๋“ค์–ด๊ฐ€๋ฉด ๊ถŒํ•œ ์„ค์ •์ด ์žˆ๋‹ค.

์—ฌ๊ธฐ์„œ ๊ถŒํ•œ์„ ์œ„ ์‚ฌ์ง„์ฒ˜๋Ÿผ ๋ณ€๊ฒฝํ•ด ์ฃผ์—ˆ๋”๋‹ˆ ๋ฌธ์ œ๊ฐ€ ํ•ด๊ฒฐ๋˜์—ˆ๋‹ค. (๋งŒ์„ธ! ๐Ÿ™Œ)

github action ์Šคํฌ๋ฆฝํŠธ๋ฅผ ๋งŒ๋“ค ๋•Œ self๋กœ ๋งŒ๋“ค์–ด์„œ ๊ทธ๋Ÿฐ์ง€ ๊ถŒํ•œ์ด ์ž ๊ฒจ์žˆ๋˜ ๊ฒƒ ๊ฐ™๋‹ค... ๋‹ค๋ฅธ ํ”„๋กœ์ ํŠธ๋“ค์„ ๋ณด๋‹ˆ ์ž๋™์œผ๋กœ ์—ด๋ ค์žˆ๋Š” ๋ถ€๋ถ„๋“ค๋„ ์žˆ์—ˆ๊ณ , Fork pull reauest ๋ถ€๋ถ„๋งŒ ๋‹ค๋ฅด๊ธฐ๋„ ํ–ˆ๋‹ค. ์ž ๊ฒจ์žˆ์œผ๋ฉด ์—ด์–ด์ฃผ์ž.


6. ๋งˆ๋ฌด๋ฆฌ

ํ”„๋กœํ•„ ๋ ˆํฌ์ง€ํ† ๋ฆฌ README์— Action์œผ๋กœ ๋งŒ๋“ค์–ด์ง„ 3D์ž”๋”” SVG๋ฅผ ๋„ฃ๊ธฐ๋งŒ ํ•˜๋ฉด ์™„์„ฑ์ด๋‹ค!

profile-3d-contirb์ด๋ผ๋Š” ๋””๋ ‰ํ„ฐ๋ฆฌ์— svg๊ฐ€ ๋งŒ๋“ค์–ด์ง€๋ฏ€๋กœ README์—์„œ ๊ฐ€์ ธ๋‹ค ์‚ฌ์šฉํ•˜๋ฉด ๋์ด๋‹ค.

![](./profile-3d-contrib/profile-night-rainbow.svg)

 

์ด๋ ‡๊ฒŒ ์ ์–ด์ฃผ๋ฉด ์™„์„ฑ์ด๋‹ค. ๋‚˜์ค‘์— ๋‹ค๋ฅธ ๋‚ด์šฉ์œผ๋กœ README๋ฅผ ๋” ๊พธ๋ฉฐ๋ณผ ์ƒ๊ฐ์ด๋‹ค.

์ฐธ๊ณ ๋กœ ๋‚œ ๋‚˜์ดํŠธ ๋ ˆ์ธ๋ณด์šฐ ๋ฒ„์ „์ด ์ด์œ ๊ฒƒ ๊ฐ™์•„์„œ ์‚ฌ์šฉํ–ˆ๋Š”๋ฐ, ๋ฐฐ๊ฒฝ์ด ๋ธ”๋ž™์ด๋ฉด ์˜ˆ์˜์ง€๋งŒ ํ™”์ดํŠธ๋ฉด ๋˜ ๋‹ค๋ฅด๋‹ค.

 

๋‚˜์˜์ง€ ์•Š์€๊ฐ€..?

 

์•„๋ฌดํŠผ ํ…Œ๋งˆ์— ๋งž์ถฐ์„œ ๋‹ค๋ฅธ ๋ฒ„์ „์„ ์‚ฌ์šฉํ•ด ๋ณด๋„๋ก ํ•˜์ž.

 

  • profile-3d-contrib/profile-green-animate.svg
  • profile-3d-contrib/profile-green.svg
  • profile-3d-contrib/profile-season-animate.svg
  • profile-3d-contrib/profile-season.svg
  • profile-3d-contrib/profile-south-season-animate.svg
  • profile-3d-contrib/profile-south-season.svg
  • profile-3d-contrib/profile-night-view.svg
  • profile-3d-contrib/profile-night-green.svg
  • profile-3d-contrib/profile-night-rainbow.svg
  • profile-3d-contrib/profile-gitblock.svg

 

 

 

+

Github Action์— ์Šค์ผ€์ค„๋Ÿฌ๊ฐ€ ์—†์–ด์„œ ๋“ฑ๋กํ•ด์•ผ ํ•˜๋Š” ์ค„ ์•Œ์•˜๋Š”๋ฐ, ์Šคํฌ๋ฆฝํŠธ์˜ ์ƒ๋‹จ์— ๋“ฑ๋ก๋˜์–ด ์žˆ์—ˆ๋‹ค.

schedule: # 03:00 JST == 18:00 UTC

์ด๋ผ๊ณ  ๋˜์–ด์žˆ๋Š”๋ฐ, ์šฐ๋ฆฌ๋‚˜๋ผ ๊ธฐ์ค€ ์ƒˆ๋ฒฝ 3์‹œ์— ์ž๋™ ์‹คํ–‰๋œ๋‹ค.

728x90