forked from langchain-ai/opengpts
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 1.95 KB
/
deploy-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Pulumi Deploy
on:
pull_request:
branches:
- develop
jobs:
preview:
name: Preview
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.AWS_REGION }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# 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
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
# Install & configure poetry
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
virtualenvs-in-project: false
# Run Poetry lock --no-update
- name: Poetry Lock
run: |
source $GITHUB_ENV
poetry lock --directory backend --no-update
# Create and activate the virtual environment
- name: Set up Python virtual environment
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
# Update the Pulumi stack
- uses: pulumi/actions@v5
with:
command: up
stack-name: brighthive/bb-assistants-dev
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}