diff options
Diffstat (limited to 'content/cronjobs-github-with-actions.md')
| -rw-r--r-- | content/cronjobs-github-with-actions.md | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/content/cronjobs-github-with-actions.md b/content/cronjobs-github-with-actions.md deleted file mode 100644 index b28e4a9..0000000 --- a/content/cronjobs-github-with-actions.md +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | --- | ||
| 2 | title: "Cronjobs on Github with Github Actions" | ||
| 3 | url: cronjobs-github-with-actions.html | ||
| 4 | date: 2023-05-27T00:35:36+02:00 | ||
| 5 | type: note | ||
| 6 | draft: false | ||
| 7 | tags: [github] | ||
| 8 | --- | ||
| 9 | |||
| 10 | In the root of your repository create a folder `.github/workflows` and in that | ||
| 11 | folder create a file a file `cron.yaml`. This file can be named whatever you | ||
| 12 | wish. But it has to be a `yaml` file. | ||
| 13 | |||
| 14 | File below (`.github/workflows/cron.yaml`) describes an action that will trigger | ||
| 15 | every six hours and it will curl example.com. | ||
| 16 | |||
| 17 | However. Be sure that you have enough credits. Free account is not that generous | ||
| 18 | with the minutes they give you for free. Check more about GitHub Actions usage | ||
| 19 | on their website https://docs.github.com/en/actions. | ||
| 20 | |||
| 21 | ```yaml | ||
| 22 | # .github/workflows/cron.yaml | ||
| 23 | name: Do a curl every 6 hours | ||
| 24 | on: | ||
| 25 | schedule: | ||
| 26 | - cron: '0 */6 * * *' | ||
| 27 | jobs: | ||
| 28 | cron: | ||
| 29 | runs-on: ubuntu-latest | ||
| 30 | steps: | ||
| 31 | - name: Call some url | ||
| 32 | run: curl 'https://example.com' | ||
| 33 | ``` | ||
