-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Docs: Split "Automation rules" into reference and how-to (Diátaxis) #9953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
37cf0d6
ed6279d
0c3c136
b4d4922
8205542
c0c3a7f
bf47743
2ca75eb
972eb98
280b837
0671993
0767f59
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
Automation Rules | ||
Automation rules | ||
================ | ||
|
||
Automation rules allow project maintainers to automate actions on new branches and tags on repositories. | ||
Automation rules allow project maintainers to automate actions on new branches and tags on Git repositories. | ||
If you are familiar with :term:`GitOps`, | ||
this might seem familiar. | ||
The goal of Read the Docs' automation rules is to be able to control versioning through your Git repository | ||
and avoid duplicating these efforts on Read the Docs. | ||
|
||
Creating an automation rule | ||
--------------------------- | ||
.. seealso:: | ||
|
||
#. Go to your project dashboard | ||
#. Click :guilabel:`Admin` > :guilabel:`Automation Rules` | ||
#. Click on :guilabel:`Add Rule` | ||
#. Fill in the fields | ||
#. Click :guilabel:`Save` | ||
:doc:`/guides/automation-rules` | ||
A practical guide to managing automated versioning of your documentation. | ||
|
||
How do they work? | ||
----------------- | ||
:doc:`/versions` | ||
General explanation of how versioning works for documentation projects on Read the Docs | ||
|
||
How automation rules work | ||
------------------------- | ||
|
||
When a new tag or branch is pushed to your repository, | ||
Read the Docs creates a new version. | ||
|
@@ -27,27 +30,31 @@ the specified action is performed on that version. | |
Versions can match multiple rules, | ||
and all matching actions will be performed on the version. | ||
|
||
Matching a version in Git | ||
------------------------- | ||
|
||
Predefined matches | ||
------------------ | ||
~~~~~~~~~~~~~~~~~~ | ||
|
||
Automation rules support several predefined version matches: | ||
Automation rules support two predefined version matches: | ||
|
||
- **Any version**: All new versions will match the rule. | ||
- **SemVer versions**: All new versions that follow `semantic versioning <https://semver.org/>`__ will match the rule. | ||
|
||
User defined matches | ||
-------------------- | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
If none of the above predefined matches meet your use case, | ||
you can use a **Custom match**. | ||
|
||
The custom match should be a valid `Python regular expression <https://docs.python.org/3/library/re.html>`__. | ||
Each new version will be tested against this regular expression. | ||
|
||
Actions | ||
------- | ||
Actions for versions | ||
-------------------- | ||
|
||
When a rule matches a new version, the specified action is performed on that version. | ||
When a rule matches a new version, | ||
the specified action is performed on that version. | ||
Currently, the following actions are available: | ||
|
||
- **Activate version**: Activates and builds the version. | ||
|
@@ -82,11 +89,8 @@ Currently, the following actions are available: | |
Order | ||
----- | ||
|
||
The order your rules are listed in :guilabel:`Admin` > :guilabel:`Automation Rules` matters. | ||
Each action will be performed in that order, | ||
so first rules have a higher priority. | ||
|
||
You can change the order using the up and down arrow buttons. | ||
When a new webhook event is received from your Git provider, | ||
All rules with a successful match will have their action triggered in the order they appear on the :guilabel:`Automation Rules` page. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I need some feedback here. In a former section, we state:
We should be more specific about the trigger. What happens when a new rule is added for a tag or branch and then something new shows up? What happens when a Git tag is deleted and re-added? |
||
|
||
.. note:: | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
How to create new versions automatically | ||
======================================== | ||
|
||
Versioning documentation to align with the project that it documents does not have to be a manual chore. | ||
If you are already versioning your Git repository, | ||
you may define your own rules that can publish your documentation with the same version that you have already specified in Git. | ||
|
||
|
||
How do they work? | ||
----------------- | ||
|
||
When a new tag or branch is pushed to your repository, | ||
Read the Docs creates a new version. | ||
|
||
All rules are evaluated for this version, in the order they are listed. | ||
If the version matches the version type and the pattern in the rule, | ||
the specified action is performed on that version. | ||
|
||
.. note:: | ||
|
||
Versions can match multiple rules, | ||
and all matching actions will be performed on the version. | ||
|
||
Adding a new rule | ||
----------------- | ||
|
||
#. Go to your project dashboard | ||
#. Click :guilabel:`Admin` > :guilabel:`Automation Rules` | ||
#. Click on :guilabel:`Add Rule` | ||
#. Fill in the fields | ||
#. Click :guilabel:`Save` | ||
|
||
|
||
Ordering your rules | ||
------------------- | ||
|
||
The order your rules are listed in :guilabel:`Admin` > :guilabel:`Automation Rules` matters. | ||
Each action will be performed in that order, | ||
so first rules have a higher priority. | ||
|
||
You can change the order using the up and down arrow buttons. | ||
|
||
.. note:: | ||
|
||
New rules are added at the end (lower priority). |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ Features | |
|
||
analytics | ||
/server-side-search/index | ||
/automation-rules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha just read this again and realized that it sounds a lot like "automation rules [verb]"
Maybe that'll make people click it, anyways :)