Skip to content

Commit

Permalink
Merge pull request #40 from edenartlab/feat/ci
Browse files Browse the repository at this point in the history
add ci
  • Loading branch information
jmilldotdev authored Jan 3, 2025
2 parents 7aef4b4 + 4607a7c commit d864447
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 53 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy to Modal Production

on:
push:
branches:
- main
pull_request:
types: [closed]
branches:
- main

jobs:
deploy:
if: github.event.pull_request.merged == true || github.event_name == 'push'
runs-on: ubuntu-latest
env:
DB: PROD

steps:
- name: Checkout main repo
uses: actions/checkout@v4

- name: Checkout workflows repo
uses: actions/checkout@v4
with:
repository: edenartlab/workflows
path: workflows

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Rye
run: |
curl -sSf https://rye-up.com/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
- name: Install dependencies
run: rye sync

- name: Configure Modal token
run: |
echo "${{ secrets.MODAL_TOKEN_ID }}" > ~/.modal/token-id
echo "${{ secrets.MODAL_TOKEN_SECRET }}" > ~/.modal/token-secret
- name: Deploy to Modal
run: rye run modal deploy ./eve/api.py
48 changes: 48 additions & 0 deletions .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy to Modal Staging

on:
push:
branches:
- staging
pull_request:
types: [closed]
branches:
- staging

jobs:
deploy:
if: github.event.pull_request.merged == true || github.event_name == 'push'
runs-on: ubuntu-latest
env:
DB: STAGE

steps:
- name: Checkout main repo
uses: actions/checkout@v4

- name: Checkout workflows repo
uses: actions/checkout@v4
with:
repository: edenartlab/workflows
path: workflows

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Rye
run: |
curl -sSf https://rye-up.com/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
- name: Install dependencies
run: rye sync

- name: Configure Modal token
run: |
echo "${{ secrets.MODAL_TOKEN_ID }}" > ~/.modal/token-id
echo "${{ secrets.MODAL_TOKEN_SECRET }}" > ~/.modal/token-secret
- name: Deploy to Modal
run: rye run modal deploy ./eve/api.py
15 changes: 10 additions & 5 deletions eve/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
import os

home_dir = str(Path.home())

# Load env variables from ~/.eve if it exists
eve_path = os.path.join(home_dir, ".eve")
env_path = ".env"

# First try ENV_PATH from environment
env_path_override = os.getenv("ENV_PATH")
if env_path_override and os.path.exists(env_path_override):
load_dotenv(env_path_override)

# Then try ~/.eve
if os.path.exists(eve_path):
load_dotenv(eve_path)
load_dotenv(eve_path, override=True)

# Load env variables from .env file if it exists
env_path = ".env"
# Finally fall back to .env
if os.path.exists(env_path):
load_dotenv(env_path, override=True)

Expand Down
1 change: 0 additions & 1 deletion eve/tools/twitter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import time
import logging
import requests
from dotenv import load_dotenv
from requests_oauthlib import OAuth1Session

from ...agent import Agent
Expand Down
9 changes: 0 additions & 9 deletions eve/tools/twitter/tweet/handler.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
import os
import argparse
import re
import time
import logging
import requests
from dotenv import load_dotenv
from requests_oauthlib import OAuth1Session

from .... import eden_utils
from ....agent import Agent
from .. import X

Expand Down
1 change: 0 additions & 1 deletion eve/tools/wallet/send_eth/handler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
from web3 import Web3
from dotenv import load_dotenv


async def handler(args: dict, db: str):
Expand Down
37 changes: 0 additions & 37 deletions scripts/test_pubsub.py

This file was deleted.

0 comments on commit d864447

Please sign in to comment.