forked from anuraghazra/github-readme-stats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create cache-stat-image.yml for GIthub Action to cache stat image.
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
45ca23e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference: anuraghazra#2603