Skip to content

Commit d9519d4

Browse files
committed
fix ci env var for typesense api key
1 parent 8c35355 commit d9519d4

4 files changed

Lines changed: 7 additions & 16 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,6 @@ jobs:
5757
run: |
5858
lttle login --api "https://eu.lttle.cloud" "$LTTLE_JWT_TOKEN"
5959
60-
- uses: actions/setup-node@v3
61-
with:
62-
node-version: 22.18.0
63-
- name: "Setting up environment variables into .env.production file"
64-
run: |
65-
echo "TYPESENSE_API_KEY='$TYPESENSE_API_KEY'" >> .env.production
66-
6760
- name: "Setting deployment"
6861
id: deploymentUrl
6962
run: |
@@ -77,12 +70,18 @@ jobs:
7770
# https://docs.docker.com/build/ci/github-actions/
7871
- name: "Deploying the application"
7972
run: ./deploy.sh
73+
env:
74+
TYPESENSE_API_KEY: ${{ vars.TYPESENSE_API_KEY }}
8075

8176
# NOTE: This has been added because we need to wait for the application to be fully up before proceeding
8277
# The status of the machine does not reflect the readiness of the service + machine to receive traffic
8378
# And we want the scraper to actually scrape the documentation post-deployment & readiness
8479
- name: "Waiting for the application to be ready"
8580
run: ./wait-for-app.sh
8681

82+
# IMPORTANT: Why do we need to wait for 5s here?
83+
- name: "Waiting for 5s for typesense-scraper to be ready"
84+
run: sleep 5
85+
8786
- name: "Restarting the application"
8887
run: ./restart.sh scraper

deploy.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ set -e
44

55
source ./deploy/utilities.bash
66

7-
if [[ -f .env.production ]]; then
8-
export $(xargs < .env.production)
9-
fi
10-
117
if [ -z "${GITHUB_HEAD_REF+x}" ]; then
128
GITHUB_HEAD_REF=$(git rev-parse --abbrev-ref HEAD)
139
export GITHUB_HEAD_REF

deploy/utilities.bash

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ deployTypeSense() {
5050

5151
echo "Deploying only the typesense-search"
5252
lttle deploy ./lttle/typesense.lttle.yaml
53-
54-
restartMachines "$ns"
5553
}
5654

5755
restartMachines() {

lttle/typesense.lttle.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ machine:
2525
environment:
2626
# FIXME: Since this is exposed to the public we need to find a way to make
2727
# a rolling API KEY that changes every-so-often
28-
# TODO: Must get this from an environment variable
29-
TYPESENSE_API_KEY: uVnR&EtnaLDfhTgLK$~'n#.NX>z
28+
TYPESENSE_API_KEY: ${{ env.TYPESENSE_API_KEY }}
3029
TYPESENSE_DATA_DIR: /data
3130
---
3231
machine:
@@ -53,7 +52,6 @@ machine:
5352
- name: nginx-docs
5453
- name: typesense-search
5554
environment:
56-
# TODO: Must get this from an environment variable
5755
TYPESENSE_API_KEY: ${{ env.TYPESENSE_API_KEY }}
5856
# This is service-name.namespace.svc.lttle.local
5957
TYPESENSE_HOST: "typesense-search-internal.docs-${{ git.ref == 'main'? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch' }}.svc.lttle.local"

0 commit comments

Comments
 (0)