diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..3a96eb2 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,35 @@ +name: Run linting and tests + +on: + push: + branches-ignore: + - main +jobs: + test-lint: + name: Test + runs-on: ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up environment variables + run: | + echo "OPENAI_AI_KEY=${{secrets.OPENAI_AI_KEY}}" >> .env + echo "OPENAI_MODEL_ID=${{secrets.OPENAI_MODEL_ID}}" >> .env + echo "OPEN_AI_EMBEDDINGS_MODEL=${{secrets.OPEN_AI_EMBEDDINGS_MODEL}}" >> .env + echo "PORT=${{secrets.PORT}}" >> .env + echo "SERVER_PORT=${{secrets.SERVER_PORT}}" >> .env + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '20' + + - name: Install dependencies + run: npm install + + - name: Run linting + run: npm run docker:lint + + - name: Run tests + run: npm run docker:test diff --git a/docker-compose.yml b/docker-compose.yml index 621d2a5..6028cff 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,15 +1,15 @@ version: '3.8' services: - redis: + redis-session: image: redis:latest restart: always - container_name: redis + container_name: redis-session ports: - - '6379:6379' + - '6380:6379' volumes: - redis_data:/data networks: - - beckn_network + - beckn_action_bot_network beckn-action-bot: image: mayurvirendra/beckn-action-bot:latest @@ -18,15 +18,14 @@ services: build: . env_file: ./.env environment: - - REDIS_URL=redis://redis:6379 + - REDIS_URL=redis://redis:6380 ports: - '${PORT}:${PORT}' - ${SERVER_PORT}:${SERVER_PORT} depends_on: - - ${DB_HOST} - - redis + - redis-session networks: - - beckn_network + - beckn_action_bot_network # volumes: # - ./:/app @@ -39,4 +38,4 @@ volumes: driver: local networks: - beckn_network: + beckn_action_bot_network: