Skip to content

Commit 82bc772

Browse files
committed
ci: add manual workflow to rebuild Solr index
Adds a workflow_dispatch-only job that runs `ckan search-index rebuild -i -q` via kubectl exec against the chosen environment (staging or production). Trigger from the Actions tab when a reindex is actually needed — most deploys don't require one, so wiring it into build-deploy.yml would just add latency and mask real indexing errors.
1 parent 63bd123 commit 82bc772

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/reindex-solr.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Rebuild Solr Index
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: "Target environment"
8+
required: true
9+
type: choice
10+
options:
11+
- staging
12+
- production
13+
14+
jobs:
15+
reindex:
16+
runs-on: ubuntu-latest
17+
environment:
18+
name: ${{ inputs.environment }}
19+
steps:
20+
- name: Set namespace
21+
id: params
22+
run: |
23+
if [[ "${{ inputs.environment }}" == "production" ]]; then
24+
echo "namespace=adr-p" >> $GITHUB_OUTPUT
25+
else
26+
echo "namespace=adr-s" >> $GITHUB_OUTPUT
27+
fi
28+
29+
- name: Setup kubeconfig
30+
run: |
31+
mkdir -p ~/.kube
32+
echo "${{ secrets.KUBECONFIG_BASE64 }}" | base64 -d > ~/.kube/config
33+
chmod 600 ~/.kube/config
34+
35+
- name: Rebuild Solr index
36+
run: |
37+
kubectl exec deployment/ckan -n ${{ steps.params.outputs.namespace }} -- \
38+
ckan -c /tmp/production.ini search-index rebuild -i -q

0 commit comments

Comments
 (0)