ocsGitHub Runner Timeout
If you need to run a job for longer than six hours, there are a couple of options.
-
Self-Hosted Runners: You can use self-hosted runners, which allow you to bypass the six hour limit. Self-hosted runners will give you more control over the environment and can run jobs for longer periods
-
Timeout Configuration: You can specify a larger timeout value in your workflow configuration using the
timeout-minutes
parameter. However, this might not work for GitHub hosted runners due to the enforced time limit
How to create self hosted runner in GitHub
Set Up Your Self-Hosted Runner
-
Access your repository on GitHub.
-
Navigate to Settings > Actions > Runners.
-
Click Add runner and follow the instructions to download and configure the runner application on your machine1.
Register the Runner
-
Run the provided registration command on your machine to connect it to your GitHub repository.
-
This will involve running a script that registers your machine as a self-hosted runner1.
Configure Your Workflow:
-
In your workflow YAML file, specify the
runs-on
key to use your self-hosted runner.Here is an example yaml file with
runs-on
self-hosted and the timeout settings.Copyjobs:
build:
runs-on: self-hosted
timeout-minutes: 720 # Example for 12 hours
steps:
- name: Checkout code
uses: actions/checkout@v2
# Add your steps here