Skip to content

Commit

Permalink
Merge pull request #1232 from AletheiaFact/set-open-ai-api-key-env-va…
Browse files Browse the repository at this point in the history
…riable

Create openai api key environment deployment
  • Loading branch information
thesocialdev authored Jun 1, 2024
2 parents 61f8da9 + fab544c commit 69bc300
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ env:
NEXT_PUBLIC_UMAMI_SITE_ID: ${{ secrets.DEVELOPMENT_UMAMI_SITE_ID }}
NEXT_PUBLIC_RECAPTCHA_SITEKEY: ${{ secrets.RECAPTCHA_SITEKEY }}
AGENTS_API_URL: ${{ secrets.DEVELOPMENT_AGENTS_API_URL }}
OPENAI_API_KEY: ${{ secrets.DEVELOPMENT_OPENAI_API_KEY }}

jobs:
setup-build-publish:
Expand Down Expand Up @@ -69,6 +70,7 @@ jobs:
echo "NEW_RELIC_APP_NAME=${{ secrets.PRODUCTION_NEW_RELIC_APP_NAME }}" >> $GITHUB_ENV
echo "NEXT_PUBLIC_ORY_SDK_URL=${{ secrets.ORY_SDK_URL }}" >> $GITHUB_ENV
echo "AGENTS_API_URL=${{ secrets.PRODUCTION_AGENTS_API_URL }}" >> $GITHUB_ENV
echo "OPENAI_API_KEY=${{ secrets.PRODUCTION_OPENAI_API_KEY }}" >> $GITHUB_ENV
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -100,6 +102,7 @@ jobs:
sed -i "s%NOVU_API_KEY%$NOVU_API_KEY%g" config.$ENVIRONMENT.yaml
sed -i "s%NOVU_APPLICATION_IDENTIFIER%$NOVU_APPLICATION_IDENTIFIER%g" config.$ENVIRONMENT.yaml
sed -i "s%AGENTS_API_URL%$AGENTS_API_URL%g" config.$ENVIRONMENT.yaml
sed -i "s%OPENAI_API_KEY%$OPENAI_API_KEY%g" config.$ENVIRONMENT.yaml
- name: Set migrate-mongo-config.ts
run: |
Expand Down Expand Up @@ -170,6 +173,7 @@ jobs:
echo "AWS_SECRET_ACCESS_KEY=${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }}" >> $GITHUB_ENV
echo "NOVU_API_KEY=${{ secrets.PRODUCTION_NOVU_API_KEY }}" >> $GITHUB_ENV
echo "NOVU_APPLICATION_IDENTIFIER=${{ secrets.PRODUCTION_NOVU_APPLICATION_IDENTIFIER }}" >> $GITHUB_ENV
echo "OPENAI_API_KEY=${{ secrets.PRODUCTION_OPENAI_API_KEY }}" >> $GITHUB_ENV
- name: Set environment
run: |
Expand All @@ -183,6 +187,7 @@ jobs:
sed -i "s%NEW_RELIC_LICENSE_KEY_STUB%${{ env.NEW_RELIC_LICENSE_KEY }}%g" deployment/app.yml
sed -i "s%NEW_RELIC_APP_NAME_STUB%${{ env.NEW_RELIC_APP_NAME }}%g" deployment/app.yml
sed -i "s%NEXT_PUBLIC_ORYSDKURL_STUB%${{ env.ORY_SDK_URL }}%g" deployment/app.yml
sed -i "s%OPENAI_API_KEY%${{ env.OPENAI_API_KEY }}%g" deployment/app.yml
- name: Set deployment
run: |
Expand Down
2 changes: 2 additions & 0 deletions config.development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ services:
novu: # Notifications provider
api_key: NOVU_API_KEY
application_identifier: NOVU_APPLICATION_IDENTIFIER
openai:
api_key: OPENAI_API_KEY

2 changes: 2 additions & 0 deletions config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ services:
endpoint: http://localhost:4566
novu: # Notifications provider
api_key: NOVU_API_KEY
openai:
api_key: OPENAI_API_KEY

2 changes: 2 additions & 0 deletions config.production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ services:
novu: # Notifications provider
api_key: NOVU_API_KEY
application_identifier: NOVU_APPLICATION_IDENTIFIER
openai:
api_key: OPENAI_API_KEY
2 changes: 2 additions & 0 deletions config.seed.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ services:
schema_id: ALETHEIA_SCHEMA_ID
novu: # Notifications provider
api_key: NOVU_API_KEY
openai:
api_key: OPENAI_API_KEY
2 changes: 2 additions & 0 deletions config.seed.test.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ services:
url: {env(GITLAB_FEATURE_FLAG_URL)}
appName: Staging
instanceId: {env(GITLAB_FEATURE_FLAG_INSTANCE_ID)}
openai:
api_key: {env(OPENAI_API_KEY)}
2 changes: 2 additions & 0 deletions config.test.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ services:
bucket: {env(AWS_SDK_BUCKET)}
accessKeyId: {env(AWS_ACCESS_KEY_ID)}
secretAccessKey: {env(AWS_SECRET_ACCESS_KEY)}
openai:
api_key: {env(OPENAI_API_KEY)}
2 changes: 2 additions & 0 deletions deployment/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ spec:
value: aletheia-ENVIRONMENT
- name: NEXT_PUBLIC_ORY_SDK_URL
value: NEXT_PUBLIC_ORYSDKURL_STUB
- name: OPENAI_API_KEY
value: OPENAI_API_KEY_STUB
- name: ENV_NAME_STUB
value: ENVIRONMENT
resources:
Expand Down
40 changes: 40 additions & 0 deletions newrelic_agent.log

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ory_infra/kratos
Submodule kratos added at 41b7c5

0 comments on commit 69bc300

Please sign in to comment.