1 | initial version |
To set up a timer in Github actions that executes on Ubuntu, follow these steps:
Create a new workflow file in your repository under .github/workflows/
.
Define the name of the workflow and specify that it should run on an Ubuntu environment. For example:
name: Timer Workflow on Ubuntu
on:
schedule:
- cron: '30 23 * * *'
push:
branches:
- master
jobs:
timer:
runs-on: ubuntu-latest
This workflow runs on a schedule every day at 11:30 PM and also when changes are pushed to the master branch.
timer
job, define the steps that should be executed when the timer is triggered. For example:jobs:
timer:
runs-on: ubuntu-latest
steps:
- name: Run a script
run: /path/to/your/script.sh
This example runs a shell script located at /path/to/your/script.sh
.
Note that Github actions has limitations on the frequency and duration of scheduled workflows. Read here for more details on scheduling limitations.