By default when new versions are created, they are not activated. So, when a new tag or branch is pushed to your repository, you need to log in your Read the Docs account to activate it or do other type of actions over that version.
To help to automate this tasks you can create an automation rule.
- Go to your project
Admin
>Automation Rules
- Click on "Add Rule" button
- Fill in the fields
- Description: A description of what the rule does
- Match: What versions the rule should be applied to
- Version type: What type of versions the rule should be applied to
- Action: What action should be applied to matching rules
- Click "Save"
New versions are matched against the type of match you chose:
- All versions: All new versions.
- SemVer versions: All new versions that follow semantic versioning.
- Custom match: If none of the above rules match your use case, you can write a regular expression.
The custom match should be a valid Python regular expression. Each new version is going to be tested against this regular expression, if it matches the corresponding action is executed against that version.
Currently we only support the following actions:
- Activate version on match: It activates and builds the version.
- Set as default version on match: It activates and builds the version too. Additionally, it sets the version as default, i.e. the version of your project that / redirects to. See more in
automatic-redirects:Root URL
.
Note
If your versions follow 440
, Read the Docs activates and builds the version if it's greater than the current stable version. See more in versions
.
The order your rules are listed in Admin
> Automation Rules
matters. Each action will be executed in that order, so first rules have a higher priority.
You can change the order using the up and down arrow buttons.
Note
All actions of the rules that the version matches will be executed over that version.
- Match:
All versions
- Version type:
Tag
- Action:
Activate version on match
- Custom match:
^1\.\d+$
- Version type:
Branch
- Action:
Activate version on match
- Custom match:
-(stable)|(release)$
- Version type:
Branch
- Action:
Set as default version on match
Note
You can also create two rules, one to match -stable
and other to match -release
.
- Custom match:
^[vV]
- Version type:
Tag
- Action:
Activate version on match
- Custom match:
^[vV]
- Version type:
Branch
- Action:
Activate version on match
- Custom match:
.*(?<!-nightly)$
- Version type:
Tag
- Action:
Activate version on match