aboutsummaryrefslogtreecommitdiff
path: root/content/notes
diff options
context:
space:
mode:
Diffstat (limited to 'content/notes')
-rw-r--r--content/notes/cronjobs-github-with-actions.md34
1 files changed, 34 insertions, 0 deletions
diff --git a/content/notes/cronjobs-github-with-actions.md b/content/notes/cronjobs-github-with-actions.md
new file mode 100644
index 0000000..08dea54
--- /dev/null
+++ b/content/notes/cronjobs-github-with-actions.md
@@ -0,0 +1,34 @@
1---
2title: "Cronjobs on Github with Github Actions"
3url: cronjobs-github-with-actions.html
4date: 2023-05-27T00:35:36+02:00
5type: notes
6draft: false
7tags: [github, actions]
8---
9
10In the root of your repository create a folder `.github/workflows` and
11in that folder create a file a file `cron.yaml`. This file can be named
12whatever you wish. But it has to be a `yaml` file.
13
14File below (`.github/workflows/cron.yaml`) describes an action that will
15trigger every six hours and it will curl example.com.
16
17However. Be sure that you have enough credits. Free account is not that
18generous with the minutes they give you for free. Check more about
19GitHub Actions usage on their website https://docs.github.com/en/actions.
20
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```