diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml new file mode 100644 index 0000000..6fd9334 --- /dev/null +++ b/.github/workflows/cron.yml @@ -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 + } + }" + }'