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