Skip to content

Commit 2201637

Browse files
authored
Create ci - cd.yml
Cicd created
1 parent a5af7b7 commit 2201637

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

‎.github/workflows/ci - cd.yml‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI/CD
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
services:
9+
postgres:
10+
image: postgres:15
11+
env:
12+
POSTGRES_DB: test
13+
POSTGRES_USER: user
14+
POSTGRES_PASSWORD: password
15+
ports: [5432:5432]
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.11'
22+
- run: pip install -r requirements.txt
23+
- run: pytest tests/
24+
25+
deploy:
26+
needs: test
27+
runs-on: ubuntu-latest
28+
if: github.ref == 'refs/heads/main'
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Build & Push Docker
32+
run: |
33+
docker build -t yourorg/validation:latest .
34+
echo ${{ secrets.DOCKER_PASS }} | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin
35+
docker push yourorg/validation:latest

0 commit comments

Comments
 (0)