Skip to content

Commit

Permalink
Create cache-stat-image.yml for GIthub Action to cache stat image.
Browse files Browse the repository at this point in the history
  • Loading branch information
YiSun88 authored Sep 13, 2023
1 parent 81f030f commit 45ca23e
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/cache-stat-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Cache Action
on:
workflow_dispatch:
schedule:
- cron: 0 */4 * * * # Every 4 hours, change it accordingly

jobs:
stats:
permissions: write-all
runs-on: ubuntu-latest
name: Stats Card
steps:
- uses: actions/checkout@v3
name: Check out current commit
- uses: suisei-cn/[email protected]
id: stats
name: Download the stats file
with:
url: "https://github-readme-stats-beryl-beta-73.vercel.app/api?username=YiSun88&theme=dark&show_icons=true&hide_border=true&count_private=true" # Put your own vercel instance URL here
target: grs
filename: stats.svg # Need to have the file name prepared as svg
- uses: actions/upload-artifact@master
with:
name: stats
path: grs

push:
permissions: write-all
runs-on: ubuntu-latest
name: Push
needs: [stats] # Put any jobs (card) needed here before we push
steps:
- uses: actions/download-artifact@master
with:
name: stats
path: grs
- name: Push
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: resource/grs # May change to your desired branch name, the final URL need to be updated if you change this
build_dir: grs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1 comment on commit 45ca23e

@YiSun88
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reference: anuraghazra#2603

Please sign in to comment.