diff --git a/.github/workflows/preview-dev.yml b/.github/workflows/preview-dev.yml index 4271fea3..38e4d980 100644 --- a/.github/workflows/preview-dev.yml +++ b/.github/workflows/preview-dev.yml @@ -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: |