Skip to content

Commit

Permalink
Bug fix and updated deployment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
caparker committed Jun 6, 2024
1 parent d39bcca commit fdc2c58
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Deploy prod

on:
on:
push:
branches:
- main
Expand Down Expand Up @@ -41,6 +41,9 @@ env:
ORIGIN: ${{ secrets.ORIGIN }}

EMAIL_SENDER: ${{ secrets.EMAIL_SENDER }}
SMTP_EMAIL_HOST: ${{ secrets.SMTP_EMAIL_HOST }}
SMTP_EMAIL_USER: ${{ secrets.SMTP_EMAIL_USER }}
SMTP_EMAIL_PASSWORD: ${{ secrets.SMTP_EMAIL_PASSWORD }}

EXPLORER_API_KEY: ${{ secrets.EXPLORER_API_KEY }}

Expand Down Expand Up @@ -68,7 +71,7 @@ jobs:
run: |
yarn install
yarn run deploy
- name: Install CDK
run: |
npm install -g [email protected]
Expand All @@ -81,7 +84,7 @@ jobs:
working-directory: ./cdk
run: |
pip install -r requirements.txt
cdk deploy openaq-api-prod --require-approval never
cdk deploy openaq-api-prod --require-approval never
update-docs:
needs: deploy
Expand All @@ -93,7 +96,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: "18"

- uses: actions/setup-python@v3
with:
python-version: '3.11'
Expand All @@ -105,4 +108,4 @@ jobs:
npm install -g rdme@latest
python generate_schema.py
VERSION=
rdme openapi openapi.json --version=$VERSION --key=${{ secrets.README_KEY }} --id=${{ secrets.README_API_DEFINITION_ID }}
rdme openapi openapi.json --version=$VERSION --key=${{ secrets.README_KEY }} --id=${{ secrets.README_API_DEFINITION_ID }}
9 changes: 6 additions & 3 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Deploy staging

on:
on:
push:
branches:
- release-*
Expand Down Expand Up @@ -40,10 +40,13 @@ env:
RATE_TIME: 1

EMAIL_SENDER: ${{ secrets.EMAIL_SENDER }}
SMTP_EMAIL_HOST: ${{ secrets.SMTP_EMAIL_HOST }}
SMTP_EMAIL_USER: ${{ secrets.SMTP_EMAIL_USER }}
SMTP_EMAIL_PASSWORD: ${{ secrets.SMTP_EMAIL_PASSWORD }}

EXPLORER_API_KEY: ${{ secrets.EXPLORER_API_KEY }}


jobs:
deploy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -80,4 +83,4 @@ jobs:
working-directory: ./cdk
run: |
pip install -r requirements.txt
cdk deploy openaq-api-staging --require-approval never
cdk deploy openaq-api-staging --require-approval never
1 change: 0 additions & 1 deletion openaq_api/openaq_api/v3/routers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def send_email(destination_email: str, msg: EmailMessage):

def send_smtp_email(destination_email: str, msg: EmailMessage):
with smtplib.SMTP_SSL(settings.SMTP_EMAIL_HOST, 465) as s:
s.starttls()
s.login(settings.SMTP_EMAIL_USER, settings.SMTP_EMAIL_PASSWORD)
return s.send_message(msg)

Expand Down

0 comments on commit fdc2c58

Please sign in to comment.