You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/actions/deployment/targeting-different-environments/using-environments-for-deployment.md
+49-10Lines changed: 49 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,10 +52,22 @@ Use required reviewers to require a specific person or team to approve workflow
52
52
53
53
For more information on reviewing jobs that reference an environment with required reviewers, see "[AUTOTITLE](/actions/managing-workflow-runs/reviewing-deployments)."
54
54
55
+
{% ifversion fpt %}{% note %}
56
+
57
+
**Note:** Required reviewers are only available for public repositories for users on {% data variables.product.prodname_free_user %}, {% data variables.product.prodname_pro %}, and {% data variables.product.prodname_team %} plans.
58
+
59
+
{% endnote %}{% endif %}
60
+
55
61
### Wait timer
56
62
57
63
Use a wait timer to delay a job for a specific amount of time after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).
58
64
65
+
{% ifversion fpt %}{% note %}
66
+
67
+
**Note:** Wait timers are only available for public repositories for users on {% data variables.product.prodname_free_user %}, {% data variables.product.prodname_pro %}, and {% data variables.product.prodname_team %} plans.
68
+
69
+
{% endnote %}{% endif %}
70
+
59
71
### Deployment branches
60
72
61
73
Use deployment branches to restrict which branches can deploy to the environment. Below are the options for deployment branches for an environment:
@@ -66,12 +78,24 @@ Use deployment branches to restrict which branches can deploy to the environment
66
78
67
79
For example, if you specify `releases/*` as a deployment branch rule, only branches whose name begins with `releases/` can deploy to the environment. (Wildcard characters will not match `/`. To match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.) If you add `main` as a deployment branch rule, a branch named `main` can also deploy to the environment. For more information about syntax options for deployment branches, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch).
68
80
81
+
{% ifversion fpt %}{% note %}
82
+
83
+
**Note:** Deployment branches are available for all public repositories. For users on {% data variables.product.prodname_pro %} or {% data variables.product.prodname_team %} plans, deployment branches are also available for private repositories.
84
+
85
+
{% endnote %}{% endif %}
86
+
69
87
{% ifversion actions-break-glass %}
70
88
### Allow administrators to bypass configured protection rules
71
89
72
90
By default, administrators can bypass the protection rules and force deployments to specific environments. For more information, see "[AUTOTITLE](/actions/managing-workflow-runs/reviewing-deployments#bypassing-environment-protection-rules)."
73
91
74
92
Alternatively, you can configure environments to disallow bypassing the protection rules for all deployments to the environment.
93
+
94
+
{% ifversion fpt %}{% note %}
95
+
96
+
**Note:** Allowing administrators to bypass protection rules is only available for public repositories for users on {% data variables.product.prodname_free_user %}, {% data variables.product.prodname_pro %}, and {% data variables.product.prodname_team %} plans.
@@ -84,6 +108,12 @@ Alternatively, you can configure environments to disallow bypassing the protecti
84
108
85
109
Once custom deployment protection rules have been created and installed on a repository, you can enable the custom deployment protection rule for any environment in the repository. For more information about configuring and enabling custom deployment protection rules, see "[AUTOTITLE](/actions/deployment/protecting-deployments/configuring-custom-deployment-protection-rules)."
86
110
111
+
{% ifversion fpt %}{% note %}
112
+
113
+
**Note:** Custom deployment protection rules are only available for public repositories for users on {% data variables.product.prodname_free_user %}, {% data variables.product.prodname_pro %}, and {% data variables.product.prodname_team %} plans.
114
+
115
+
{% endnote %}{% endif %}
116
+
87
117
{% endif %}
88
118
89
119
## Environment secrets
@@ -96,7 +126,7 @@ Secrets stored in an environment are only available to workflow jobs that refere
96
126
**Notes:**
97
127
98
128
- Workflows that run on self-hosted runners are not run in an isolated container, even if they use environments. Environment secrets should be treated with the same level of security as repository and organization secrets. For more information, see "[AUTOTITLE](/actions/security-guides/security-hardening-for-github-actions#hardening-for-self-hosted-runners)."
99
-
- Environment secrets are only available in **public** repositories if you are using {% data variables.product.prodname_free_user %}, {% data variables.product.prodname_pro %}, or {% data variables.product.prodname_team %}. For access to environment secrets in **private** or **internal** repositories, you must use {% data variables.product.prodname_pro %}, {% data variables.product.prodname_team %}, or {% data variables.product.prodname_enterprise %}. For more information on switching your subscription, see "[AUTOTITLE](/billing/managing-billing-for-your-github-account/upgrading-your-github-subscription)."
129
+
- Environment secrets are only available in public repositories if you are using {% data variables.product.prodname_free_user %}. For access to environment secrets in private or internal repositories, you must use {% data variables.product.prodname_pro %}, {% data variables.product.prodname_team %}, or {% data variables.product.prodname_enterprise %}. For more information on switching your subscription, see "[AUTOTITLE](/billing/managing-billing-for-your-github-account/upgrading-your-github-subscription)."
100
130
101
131
{% endnote %}
102
132
{% else %}
@@ -113,14 +143,23 @@ Secrets stored in an environment are only available to workflow jobs that refere
113
143
Variables stored in an environment are only available to workflow jobs that reference the environment. These variables are only accessible using the [`vars`](/actions/learn-github-actions/contexts#vars-context) context. For more information, see "[AUTOTITLE](/actions/learn-github-actions/variables)."
114
144
{% endif %}
115
145
146
+
{% ifversion fpt %}{% note %}
147
+
148
+
**Note:** Environment variables are available for all public repositories. For users on {% data variables.product.prodname_pro %} or {% data variables.product.prodname_team %} plans, environment variables are also available for private repositories.
149
+
150
+
{% endnote %}{% endif %}
151
+
116
152
## Creating an environment
117
153
118
154
{% data reusables.actions.permissions-statement-environment %}
119
155
120
-
{% ifversion fpt or ghec %}
156
+
{% ifversion fpt %}
121
157
{% note %}
122
158
123
-
**Note:** Creation of an environment in a private repository is available to organizations with {% data variables.product.prodname_team %} and users with {% data variables.product.prodname_pro %}.
159
+
**Notes:**
160
+
161
+
- Creation of an environment in a private repository is available to organizations with {% data variables.product.prodname_team %} and users with {% data variables.product.prodname_pro %}.
162
+
- Some features for environments have no or limited availability for private repositories. If you are unable to access a feature described in the instructions below, please see the documentation linked in the related step for availability information.
124
163
125
164
{% endnote %}
126
165
{% endif %}
@@ -130,34 +169,34 @@ Variables stored in an environment are only available to workflow jobs that refe
130
169
{% data reusables.actions.sidebar-environment %}
131
170
{% data reusables.actions.new-environment %}
132
171
{% data reusables.actions.name-environment %}
133
-
1. Optionally, specify people or teams that must approve workflow jobs that use this environment.
172
+
1. Optionally, specify people or teams that must approve workflow jobs that use this environment. For more information, see "[Required reviewers](#required-reviewers)."
134
173
1. Select **Required reviewers**.
135
174
1. Enter up to 6 people or teams. Only one of the required reviewers needs to approve the job for it to proceed.
136
175
1. Click **Save protection rules**.
137
-
1. Optionally, specify the amount of time to wait before allowing workflow jobs that use this environment to proceed.
176
+
1. Optionally, specify the amount of time to wait before allowing workflow jobs that use this environment to proceed. For more information, see "[Wait timer](#wait-timer)."
138
177
1. Select **Wait timer**.
139
178
1. Enter the number of minutes to wait.
140
179
1. Click **Save protection rules**.
141
180
{%- ifversion actions-break-glass %}
142
-
1. Optionally, disallow bypassing configured protection rules. For more information about bypassing configured protection rules, see "[AUTOTITLE](/actions/managing-workflow-runs/reviewing-deployments)."
181
+
1. Optionally, disallow bypassing configured protection rules. For more information, see "[Allow administrators to bypass configured protection rules](#allow-administrators-to-bypass-configured-protection-rules)."
143
182
1. Deselect **Allow administrators to bypass configured protection rules**.
1. Optionally, enable any custom deployment protection rules that have been created with {% data variables.product.prodname_github_apps %}. For more information about configuring custom deployment protection rules with {% data variables.product.prodname_github_apps %}, see "[AUTOTITLE](/actions/deployment/protecting-deployments/configuring-custom-deployment-protection-rules)."
186
+
1. Optionally, enable any custom deployment protection rules that have been created with {% data variables.product.prodname_github_apps %}. For more information, see "[Custom deployment protection rules](#custom-deployment-protection-rules)."
148
187
1. Select the custom protection rule you want to enable.
149
188
1. Click **Save protection rules**.
150
189
{%- endif %}
151
-
1. Optionally, specify what branches can deploy to this environment. For more information about the possible values, see "[Deployment branches](#deployment-branches)."
190
+
1. Optionally, specify what branches can deploy to this environment. For more information, see "[Deployment branches](#deployment-branches)."
152
191
1. Select the desired option in the **Deployment branches** dropdown.
153
192
1. If you chose **Selected branches**, enter the branch name patterns that you want to allow.
154
-
1. Optionally, add environment secrets. These secrets are only available to workflow jobs that use the environment. Additionally, workflow jobs that use this environment can only access these secrets after any configured rules (for example, required reviewers) pass. For more information about secrets, see "[AUTOTITLE](/actions/security-guides/encrypted-secrets)."
193
+
1. Optionally, add environment secrets. These secrets are only available to workflow jobs that use the environment. Additionally, workflow jobs that use this environment can only access these secrets after any configured rules (for example, required reviewers) pass. For more information, see "[Environment secrets](#environment-secrets)."
155
194
1. Under **Environment secrets**, click **Add Secret**.
156
195
1. Enter the secret name.
157
196
1. Enter the secret value.
158
197
1. Click **Add secret**.
159
198
{%- ifversion actions-configuration-variables %}
160
-
6. Optionally, add environment variables. These variables are only available to workflow jobs that use the environment, and are only accessible using the [`vars`](/actions/learn-github-actions/contexts#vars-context) context. For more information, see "[AUTOTITLE](/actions/learn-github-actions/variables)."
199
+
6. Optionally, add environment variables. These variables are only available to workflow jobs that use the environment, and are only accessible using the [`vars`](/actions/learn-github-actions/contexts#vars-context) context. For more information, see "[Environment variables](#environment-variables)."
161
200
1. Under **Environment variables**, click **Add Variable**.
Custom deployment protection rules are available in public repositories for all plans. For access to custom deployment protection rules in private or internal repositories, you must use {% data variables.product.prodname_enterprise %}. {% data reusables.gated-features.more-info %}
0 commit comments