diff --git a/.env.sample b/.env.sample index 9dadd78c3..694f780bc 100644 --- a/.env.sample +++ b/.env.sample @@ -1,13 +1,13 @@ PYTHON_ENV=dev DB_TYPE=postgresql -DB_NAME="" -DB_USER="" -DB_PASSWORD="" -DB_HOST="" +DB_NAME=test +DB_USER=username +DB_PASSWORD=password +DB_HOST="localhost" DB_PORT=5432 MYSQL_DRIVER= -DB_URL=postgresql://username:password@host:PORT/dbname +DB_URL=postgresql://username:password@localhost:5432/test SECRET_KEY = "" ALGORITHM = HS256 ACCESS_TOKEN_EXPIRE_MINUTES = 10 diff --git a/.github/workflows/cd.prod.yml b/.github/workflows/cd.prod.yml index f3cefc3b3..7fea7bc3b 100644 --- a/.github/workflows/cd.prod.yml +++ b/.github/workflows/cd.prod.yml @@ -1,4 +1,4 @@ -name: Dev Branch Deployment +name: Prod Branch Deployment on: workflow_run: diff --git a/.github/workflows/cd.staging.yml b/.github/workflows/cd.staging.yml index 501970dfa..0015dbe7b 100644 --- a/.github/workflows/cd.staging.yml +++ b/.github/workflows/cd.staging.yml @@ -1,4 +1,4 @@ -name: Dev Branch Deployment +name: Staging Branch Deployment on: workflow_run: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c36e7b435..ea23fe0bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [main, staging, dev] + branches: [main, staging, dev, devops-main] pull_request: - branches: [main, staging, dev] + branches: [main, staging, dev, devops-main] jobs: build-and-test: @@ -14,9 +14,9 @@ jobs: postgres: image: postgres:latest env: - POSTGRES_USER: - POSTGRES_PASSWORD: - POSTGRES_DB: + POSTGRES_USER: 'username' + POSTGRES_PASSWORD: "password" + POSTGRES_DB: "test" ports: - 5432:5432 @@ -34,16 +34,22 @@ jobs: run: | pip install -r requirements.txt - # - name: Copy env file - # run: cp .env.sample .env + - name: Copy env file + run: cp .env.sample .env + + - name: Run app + run: | + python3 main.py & + pid=$! + sleep 10 + if ps -p $pid > /dev/null; then + echo "main.py started successfully" + kill $pid + else + echo "main.py failed to start" + exit 1 + fi - # - name: Copy env file for main - # if: github.ref == 'refs/heads/main' - # run: cp .env.production .env - - # - name: Copy env file for staging - # if: github.ref == 'refs/heads/staging' - # run: cp .env.staging .env # - name: Run migrations # run: |