Skip to content

Commit 9cc343a

Browse files
committed
Only run alogolia indexing on main
1 parent ad7de19 commit 9cc343a

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

.circleci/config.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,29 +138,29 @@ jobs:
138138
message: "Production deployment job failed for branch ${CIRCLE_BRANCH}"
139139

140140
workflows:
141-
lint:
142-
unless:
143-
equal: [main, << pipeline.git.branch >>]
141+
main:
144142
jobs:
145143
- vale/lint:
146144
reference_branch: main
147145
base_dir: docs
148-
build_validate_and_deploy:
149-
jobs:
146+
filters:
147+
branches:
148+
ignore: main
149+
150150
- build:
151151
context: circleci-docs-static
152+
152153
- validate:
153154
requires: [build]
155+
154156
- deploy-production:
155157
requires: [validate]
156158
filters:
157159
branches:
158160
only: main
159161
context:
160-
[
161-
circleci-docs-static,
162-
docs-platform-assets,
163-
web-ui-npm,
164-
web-ui-datadog,
165-
]
162+
- circleci-docs-static
163+
- docs-platform-assets
164+
- web-ui-npm
165+
- web-ui-datadog
166166
bucket_name: "circleci-docs-platform-assets"

extensions/export-content-extension.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,11 @@ function getNavEntriesByUrl(items = [], accum = {}, trail = []) {
101101
}
102102

103103
function shouldSkipIndexing() {
104+
if (process.env.CI === 'true') {
105+
return process.env.CIRCLE_BRANCH === 'main';
106+
}
107+
104108
const val = (process.env.SKIP_INDEX_SEARCH || '').toLowerCase();
105-
const ci = (process.env.CI || '').toLowerCase();
106-
if (ci === 'true' || ci === '1') return false;
107109
return ['1', 'true'].includes(val);
108110
}
109111

@@ -277,4 +279,4 @@ async function waitForTask(client, indexName, taskID, timeout = 60000, pollInter
277279
}
278280

279281
throw new Error(`Task ${taskID} timed out after ${timeout}ms`);
280-
}
282+
}

0 commit comments

Comments
 (0)