How to Schedule a Nightly Pipeline in CircleCI
Scheduled pipelines fire on a cron and can set pipeline parameters to branch the config.
Define a scheduled trigger that sets a parameter like run_nightly, then guard heavy jobs with a when: clause that reads it.
Parameter-driven nightly run
A pipeline parameter set by the schedule selects the nightly workflow.
.circleci/config.yml
version: 2.1
parameters:
run_nightly:
type: boolean
default: false
workflows:
nightly:
when: << pipeline.parameters.run_nightly >>
jobs:
- full-regressionNotes
- Create the schedule in Project Settings > Triggers and have it set run_nightly: true.
- Scheduled pipelines replaced the deprecated cron under the legacy triggers key.
- Keep the default false so normal pushes skip the nightly-only workflow.
Related guides
How to Use Dynamic Config with a Setup Workflow in CircleCIEnable dynamic config in CircleCI with a setup workflow that generates a continuation config at runtime, so t…
How to Store Test Insights in CircleCIUpload JUnit results in CircleCI with store_test_results to power the Tests tab and Insights, surfacing flaky…