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