Skip to content

Commit b00f587

Browse files
committed
Add CI/CD workflow for GitHub Actions
1 parent 20d8b64 commit b00f587

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.8, 3.9, "3.10"]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -r requirements.txt
27+
pip install pytest
28+
29+
- name: Run tests
30+
run: |
31+
pytest tests/
32+
33+
build:
34+
runs-on: ubuntu-latest
35+
needs: test
36+
if: github.ref == 'refs/heads/master'
37+
38+
steps:
39+
- uses: actions/checkout@v3
40+
- name: Build and publish Docker image
41+
run: |
42+
# Сборка Docker-образа
43+
docker build -f deployment/docker/Dockerfile.unified -t zerolink:${{ github.sha }} .
44+
docker tag zerolink:${{ github.sha }} zerolink:latest

0 commit comments

Comments
 (0)