Skip to content

Commit

Permalink
add CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Apr 7, 2024
1 parent 84d6f22 commit 2e4ddb4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI / CD

on:
push:
pull_request:

jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build and run tests
run: docker-compose up --build test

- name: Clean up
run: docker-compose down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.py[cod]
*.venv
*data/
.env
.env.BCK
/env/
/infrastructure/vars/local.tfvars
__pycache__/
6 changes: 1 addition & 5 deletions api/app/config/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Global configuration for the application."""

import os
from functools import lru_cache
from pydantic_settings import BaseSettings

Expand All @@ -15,10 +15,6 @@ class Settings(BaseSettings):
auth_token: str
tif_path: str

class Config: # noqa: D106
env_file = ".env"


@lru_cache
def get_settings() -> Settings:
"""Return the global configuration."""
Expand Down
Empty file added api/tests/__init__.py
Empty file.
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
version: '3.7'
version: '3.9'
services:
api:
build:
context: ./api
dockerfile: Dockerfile
ports:
- "8000:8000"
env_file:
- .env
environment:
- AUTH_TOKEN=${AUTH_TOKEN}
- TIFF_PATH=${TIFF_PATH}
networks:
- amazonia360-network
restart:
Expand All @@ -17,8 +18,7 @@ services:
build:
context: ./api
dockerfile: Dockerfile
env_file:
- .env.test
env_file: .env.test
networks:
- amazonia360-network

Expand Down

0 comments on commit 2e4ddb4

Please sign in to comment.