Added cronjob for creating new dailyStats document at midnight every night.
This commit is contained in:
24
.github/workflows/cron.yml
vendored
Normal file
24
.github/workflows/cron.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: Hourly cron job
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *"
|
||||||
|
jobs:
|
||||||
|
cron:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Daily cron job | Create new dailyStats document.
|
||||||
|
run: |
|
||||||
|
curl --request POST \
|
||||||
|
--url 'bot-stats.lucids-cove.duckdns.org/api/graphql' \
|
||||||
|
--header 'x-api-key: ${{ secrets.GRAPHQL_API_KEY }}' \
|
||||||
|
--data '{
|
||||||
|
"query": "mutation Cron {
|
||||||
|
cronJob(mutationKey: ${{ secrets.GRAPHQL_MUTATION_KEY }}) {
|
||||||
|
commandResponses
|
||||||
|
createdAt
|
||||||
|
linksDeleted
|
||||||
|
timesTriggered
|
||||||
|
updatedAt
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
}'
|
||||||
Reference in New Issue
Block a user