Skip to content

Commit

Permalink
task: Secrets manager retrieval for preview workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianmf94 committed Jun 21, 2024
1 parent 9a5e554 commit 0da197c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/preview-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: Install AWS CLI
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
# Retrieve and set environment variables from AWS Secrets Manager
- name: Retrieve secrets from AWS Secrets Manager
run: |
aws secretsmanager get-secret-value --secret-id opengpts-env-variables --query 'SecretString' --output text | jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' > .env
more .env
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}

# Create and activate the virtual environment
- name: Set up Python virtual environment
run: |
Expand Down

0 comments on commit 0da197c

Please sign in to comment.