Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy to Clever Cloud

on:
workflow_run:
workflows: ["pytest"]
types:
- completed
branches:
- main

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Clever Tools CLI
run: |
CC_VERSION=latest
curl -s -O https://clever-tools.clever-cloud.com/releases/${CC_VERSION}/clever-tools-${CC_VERSION}_linux.tar.gz
tar -xvf clever-tools-${CC_VERSION}_linux.tar.gz
PATH=${PATH}:$(pwd)/clever-tools-${CC_VERSION}_linux

- name: Login to Clever Cloud
run: ./clever-tools-latest_linux/clever login --token ${{ secrets.CLEVER_TOKEN }} --secret ${{ secrets.CLEVER_SECRET }}

- name: Deploy API to Clever Cloud
run: |
./clever-tools-latest_linux/clever link ${{ secrets.CLEVER_APP_ID }}
./clever-tools-latest_linux/clever deploy -f
14 changes: 7 additions & 7 deletions app/core/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import os
from typing import List

class Settings:
from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')

# API Configuration
app_name: str = "Ecologits API"
app_version: str = "1.0.0"
Expand All @@ -16,10 +20,6 @@ class Settings:
api_v1_prefix: str = "/v1"
docs_url: str = "/docs"
redoc_url: str = "/redoc"

# Environment-based overrides
def __init__(self):
self.app_name = os.getenv("APP_NAME", self.app_name)
self.app_version = os.getenv("APP_VERSION", self.app_version)


settings = Settings()
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ requires-python = ">=3.10,<4"
dependencies = [
"fastapi[standard]>=0.128.4,<1.0.0",
"ecologits>=0.9.2,<1.0.0",
"pydantic-settings>=2.12.0",
]

[dependency-groups]
Expand Down
2 changes: 2 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.