Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ jobs:
run: |
lttle login --api "https://eu.lttle.cloud" "$LTTLE_JWT_TOKEN"

- uses: actions/setup-node@v3
with:
node-version: 22.18.0
- name: "Setting up environment variables into .env.production file"
run: |
echo "TYPESENSE_API_KEY='$TYPESENSE_API_KEY'" >> .env.production

- name: "Setting deployment"
id: deploymentUrl
run: |
Expand All @@ -77,12 +70,18 @@ jobs:
# https://docs.docker.com/build/ci/github-actions/
- name: "Deploying the application"
run: ./deploy.sh
env:
TYPESENSE_API_KEY: ${{ vars.TYPESENSE_API_KEY }}

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

# IMPORTANT: Why do we need to wait for 5s here?
- name: "Waiting for 30s for typesense-scraper to be ready"
run: sleep 30s

- name: "Restarting the application"
run: ./restart.sh scraper
4 changes: 0 additions & 4 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ set -e

source ./deploy/utilities.bash

if [[ -f .env.production ]]; then
export $(xargs < .env.production)
fi

if [ -z "${GITHUB_HEAD_REF+x}" ]; then
GITHUB_HEAD_REF=$(git rev-parse --abbrev-ref HEAD)
export GITHUB_HEAD_REF
Expand Down
2 changes: 0 additions & 2 deletions deploy/utilities.bash
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ deployTypeSense() {

echo "Deploying only the typesense-search"
lttle deploy ./lttle/typesense.lttle.yaml

restartMachines "$ns"
}

restartMachines() {
Expand Down
4 changes: 1 addition & 3 deletions lttle/typesense.lttle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ machine:
environment:
# FIXME: Since this is exposed to the public we need to find a way to make
# a rolling API KEY that changes every-so-often
# TODO: Must get this from an environment variable
TYPESENSE_API_KEY: uVnR&EtnaLDfhTgLK$~'n#.NX>z
TYPESENSE_API_KEY: ${{ env.TYPESENSE_API_KEY }}
TYPESENSE_DATA_DIR: /data
---
machine:
Expand All @@ -53,7 +52,6 @@ machine:
- name: nginx-docs
- name: typesense-search
environment:
# TODO: Must get this from an environment variable
TYPESENSE_API_KEY: ${{ env.TYPESENSE_API_KEY }}
# This is service-name.namespace.svc.lttle.local
TYPESENSE_HOST: "typesense-search-internal.docs-${{ git.ref == 'main'? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch' }}.svc.lttle.local"
Expand Down
Loading