Skip to content

Commit 98d4f4a

Browse files
committed
feat: add workflow to refresh npm downloads daily
1 parent d08dd8a commit 98d4f4a

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Refresh npm downloads
2+
3+
# Redeploys the docs site daily so the build-time npm download counter
4+
# (docs/.vitepress/config.ts `npm-downloads-fetch` plugin) re-fetches and
5+
# bakes a fresh total into the static HTML.
6+
7+
on:
8+
schedule:
9+
# 06:15 UTC daily. GitHub cron can drift by a few minutes under load.
10+
- cron: '15 6 * * *'
11+
workflow_dispatch: {}
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
redeploy:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Trigger Vercel deploy hook
21+
run: |
22+
if [ -z "${VERCEL_DEPLOY_HOOK_URL}" ]; then
23+
echo "::error::VERCEL_DEPLOY_HOOK_URL secret is not set"
24+
exit 1
25+
fi
26+
curl --fail --silent --show-error -X POST "${VERCEL_DEPLOY_HOOK_URL}"
27+
env:
28+
VERCEL_DEPLOY_HOOK_URL: ${{ secrets.VERCEL_DEPLOY_HOOK_URL }}

0 commit comments

Comments
 (0)