GithubHelp home page GithubHelp logo

rehborn / github-activity-svg Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 11 KB

Generate Monthly Calendar SVGs for GitHub and Wakatime activities

Dockerfile 4.96% Python 95.04%
github-action github-contributions github-profile wakatime-stats

github-activity-svg's Introduction

GitHub Activity SVG

Generate Monthly Calendar SVGs for GitHub and Wakatime activies

Github Wakatime
GitHub Wakatime
  • enable GitHub Pages for the repository
  • optional: add WAKATIME_JSON_URL to repository secrets (create a JSON embed at wakatime JSON, Coding Activity)

Simple Action Usage

      - name: "Run Github Activity Action"
        uses: rehborn/[email protected]
        with:
          months: 12
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GH_ACTOR: ${{ github.actor }}
          WAKATIME_JSON_URL: ${{ secrets.WAKATIME_JSON_URL }}

the action will store all SVGs in dist/, output filenames suffix the index, starting with 0 as the current month, going back in time as the index increases:

  • gitlab-0.svg (this month)
  • gitlab-1.svg (last month)
  • wakatime-0.svg
  • wakatime-1.svg

Complete Example Creating Artifact and Pushing to GitHub Pages

name: Run Github Activity Action

on:
  workflow_dispatch:
    inputs:
      months:
        type: choice
        description: 'number of months to generate'
        options:
        - "1"
        - "2"
        - "3"
        - "6"
        - "12"
        - "24"

  schedule:
    - cron: '0 0,12,18 * * *'

permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  generate-and-publish-svg:
    name: Generate Activity SVGs and Publish to Github Pages
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: "Run Github Activity Action"
        uses: rehborn/[email protected]
        with:
          months: ${{ inputs.months || '3' }}
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GH_ACTOR: ${{ github.actor }}
          WAKATIME_JSON_URL: ${{ secrets.WAKATIME_JSON_URL }}

      - name: Upload Web artifact
        uses: actions/upload-pages-artifact@v2
        with:
          path: ./dist/

      - name: Deploying Web artifact
        uses: actions/deploy-pages@v2

Dependencies

github-activity-svg's People

Contributors

rehborn avatar

Stargazers

 avatar  avatar

Watchers

 avatar

github-activity-svg's Issues

Roadmap

  • add LICENSE
  • update README for local usage (see .env.example)
  • update action image and color

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.