1. Tạo thẻ trong CI hoặc trên máy.
  2. Xuất bản tệp lên một nhánh, artifact hoặc thư mục công khai.
  3. Nhúng các tệp đã xuất bản vào README hồ sơ của bạn.

GitHub Action

Workflow này vẽ bốn thẻ mỗi ngày và commit chúng vào nhánh output qua publish_branch, thay thế commit trước đó để kho mã luôn gọn nhẹ. Mọi tùy chọn cấu hình cũng là đầu vào Action, và tóm tắt job hiện bản xem trước kèm đoạn README.

.github/workflows/profile-graphics.yml
name: Generate profile graphics

on:
  schedule:
    - cron: "0 0 * * *"
  workflow_dispatch:

jobs:
  generate:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v7
      - uses: mikhailkhorokhorin/profile-graphics@v1
        with:
          user: ${{ github.repository_owner }}
          token: ${{ secrets.GITHUB_TOKEN }}
          charts: streak,summary,langs,calendar
          publish_branch: output

Nhúng vào README

Thay <user> bằng tên người dùng GitHub của bạn. Dùng một ảnh cho mỗi thẻ, hoặc layout: dashboard để có một ảnh duy nhất.

README.md
![Streak](https://raw.githubusercontent.com/<user>/<user>/output/streak.svg)
![Summary](https://raw.githubusercontent.com/<user>/<user>/output/summary.svg)
![Languages](https://raw.githubusercontent.com/<user>/<user>/output/langs.svg)
![Calendar](https://raw.githubusercontent.com/<user>/<user>/output/calendar.svg)

GitLab CI

Lưu một token có phạm vi read_user và read_api làm biến CI GITLAB_TOKEN.

.gitlab-ci.yml
stages:
  - generate

generate-profile-graphics:
  image: node:22
  stage: generate
  script:
    - npm install -g profile-graphics
    - profile-graphics generate --provider gitlab --user "$GITLAB_USER_LOGIN" --token "$GITLAB_TOKEN" --output public/cards
  artifacts:
    paths:
      - public/cards

CLI

Ghi cấu hình khởi đầu, tạo trên máy, thử giao diện không cần token hoặc xem trước một cấu hình.

shell
npm install -g profile-graphics
profile-graphics init --user octocat
profile-graphics generate --user octocat --token "$GITHUB_TOKEN" --charts streak,langs --output dist
profile-graphics demo --theme tokyo-night --output dist/demo
profile-graphics preview --config profile-graphics.yml --demo