Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 30a4424

Browse files
committed
chore(ci): only run deploy-code-firebase on master
Previously, the `deploy-code-firebase` CI job was run on any build corresponding to a git tag, the master branch or the stable branch. Given that all runs of `deploy-code-firebase` deploy to the same Firebase project (and overwrites previous deployments), there is no point in deploying from multiple branches/tags. This commit fixes this by ensuring that we only run the `deploy-code-firebase` job on builds for the master branch, which contains the most up-to-date code/configuration.
1 parent a6fa1ce commit 30a4424

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

.circleci/config.yml

+21-13
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ var-filter-run-always: &run-always
5252
tags:
5353
only: /v1\.\d+\.\d.*/
5454

55+
# Filter to run a job when code might need to be deployed - i.e. on builds for the `master` branch.
56+
# (Further checks are needed to determine whether a deployment is actually needed, but these are not
57+
# possible via filters.)
58+
var-filter-run-on-master: &run-on-master
59+
filters:
60+
branches:
61+
only:
62+
- master
63+
tags:
64+
ignore: /.*/
65+
5566
# Filter to run a job when code/docs might need to be deployed - i.e. on tagged builds and on builds
5667
# for master and `v1.*.x` branches.
5768
# (Further checks are needed to determine whether a deployment is actually needed, but these are not
@@ -222,13 +233,6 @@ commands:
222233
no_output_timeout: 30m
223234
- stop_saucelabs
224235

225-
deploy_code_prerequisites:
226-
steps:
227-
- skip_on_pr_and_fork_builds
228-
- custom_attach_workspace
229-
- init_environment
230-
- skip_unless_tag_or_master_or_stable_branch
231-
232236
# Job definitions
233237
# Jobs can include parameters that are passed in the workflow job invocation.
234238
# https://circleci.com/docs/2.0/reusing-config/#authoring-parameterized-jobs
@@ -363,7 +367,10 @@ jobs:
363367
executor:
364368
name: cloud-sdk
365369
steps:
366-
- deploy_code_prerequisites
370+
- skip_on_pr_and_fork_builds
371+
- custom_attach_workspace
372+
- init_environment
373+
- skip_unless_tag_or_master_or_stable_branch
367374
- run: ls scripts/code.angularjs.org-firebase/deploy
368375
- run:
369376
name: Authenticate and configure Docker
@@ -378,14 +385,15 @@ jobs:
378385
# The `deploy-code-firebase` job should only run when all of these conditions are true for the build:
379386
# - It is for the `angular/angular.js` repository (not a fork).
380387
# - It is not for a pull request.
381-
# - It is for a tag or the master branch or the stable branch(*).
382-
#
383-
# *: The stable branch is the one that has the value `latest` in `package.json > distTag`.
388+
# - It is for the master branch.
389+
# (This is enforced via job filters, so we don't need to a step to check it here.)
384390
deploy-code-firebase:
385391
executor:
386392
name: default-executor
387393
steps:
388-
- deploy_code_prerequisites
394+
- skip_on_pr_and_fork_builds
395+
- custom_attach_workspace
396+
- init_environment
389397
# Install dependencies for Firebase functions to prevent parsing errors during deployment.
390398
# See https://github.com/angular/angular.js/pull/16453.
391399
- run:
@@ -492,7 +500,7 @@ workflows:
492500
requires:
493501
- prepare-deployment
494502
- deploy-code-firebase:
495-
<<: *run-on-tags-and-master-and-version-branches
503+
<<: *run-on-master
496504
requires:
497505
- prepare-deployment
498506
- deploy-docs:

0 commit comments

Comments
 (0)