Skip to content

fix: index segment generation for search records (#1779) #493

fix: index segment generation for search records (#1779)

fix: index segment generation for search records (#1779) #493

name: Deploy FDR Dev
on:
push:
branches:
- main
paths:
- "fern/apis/fdr/**"
- "fern/fern.config.json"
- "servers/fdr-deploy/**"
- "servers/fdr/**"
- ".github/workflows/deploy-fdr-dev.yml"
- ".github/workflows/publish-fdr-sdk.yml"
- "packages/fdr-sdk/**"
- "pnpm-lock.yaml"
env:
PACKAGE_NAME: "@fern-platform/fdr"
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: "buildwithfern"
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
FERNIE_SLACK_APP_TOKEN: ${{ secrets.FERNIE_SLACK_APP_TOKEN }}
GITHUB_TOKEN: ${{ secrets.FERN_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}
jobs:
sdk:
uses: ./.github/workflows/publish-fdr-sdk.yml
secrets: inherit
deploy_dev:
runs-on: ubuntu-latest
environment: Fern Dev
strategy:
matrix:
concurrency: [1]
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}/fdr?schema=public
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_ADMIN_API_KEY: ${{ secrets.ALGOLIA_ADMIN_API_KEY }}
ALGOLIA_SEARCH_INDEX: ${{ secrets.ALGOLIA_SEARCH_INDEX }}
ALGOLIA_SEARCH_V2_DOMAINS: "workato,rohin-bhargava-staging,monite,humanloop,cohere,buildwithfern.com/learn"
ALGOLIA_SEARCH_API_KEY: ${{ secrets.ALGOLIA_SEARCH_API_KEY }}
APPLICATION_ENVIRONMENT: dev
steps:
- uses: actions/checkout@v4
- name: πŸ“₯ Install
uses: ./.github/actions/install
- name: πŸ”Ž Has changed
id: has-changed
# if there are changes, npx turbo-ignore returns a failure exit code
# which makes steps.has-changed.outputs.RESULT = 'true'
run: npx turbo-ignore ${{ env.PACKAGE_NAME }} || echo "RESULT=true" >> $GITHUB_OUTPUT
- name: πŸ§ͺ Build and test
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
pnpm turbo codegen build test --filter=${{ env.PACKAGE_NAME }}
pnpm --filter "@fern-platform/fdr" sentry:sourcemaps
- name: πŸ’» Setup AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
# Currently we migrate in the Docker container
# - name: πŸ”„ DB Migration
# run: pnpm run --filter=@fern-platform/fdr db:migrate:dev
# env:
# DATABASE_URL: ${{ secrets.DEV_POSTGRES_URL }}/fdr?schema=public
- name: πŸš€ cdk deploy
run: |
git_version="$(scripts/git-version.sh)"
pnpm --filter=@fern-platform/fdr run docker:dev "${git_version}"
npm install -g aws-cdk
cd servers/fdr-deploy
VERSION="${git_version}" pnpm --filter=@fern-platform/fdr-deploy deploy:dev
env:
DATABASE_URL: ${{ secrets.DEV_POSTGRES_URL }}/fdr?schema=public
smoke-test:
needs: deploy_dev
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Smoke Test Dev Docs
env:
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}
FERN_TOKEN: ${{ secrets.FERN_ORG_TOKEN_DEV }}
run: |
cd smoke-test
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
npm install -g @fern-api/fern-api-dev
fern-dev generate --docs --instance https://fern-platform-test.docs.dev.buildwithfern.com
VALUE=$(curl https://fern-platform-test.docs.dev.buildwithfern.com/api-reference/imdb/create-movie)
length=${#VALUE}
# Assert that length is over 1000
if [ $length -gt 1000 ]; then
echo "Length is greater than 1000"
else
exit 1
fi