Skip to content

Commit ff947c7

Browse files
authored
Create docker-image.yml
1 parent c1c9c22 commit ff947c7

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build-and-test:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
service:
17+
- Hate_Speech
18+
- Click-Bait
19+
- Security-Header
20+
- SSL
21+
- FakeNewsAPI
22+
- ImageAPI
23+
- News_Origin
24+
- ReportAPI
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v3
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: 3.10
34+
35+
- name: Build Docker image for ${{ matrix.service }}
36+
run: |
37+
docker build -t ${{ matrix.service }} ./server/${{ matrix.service }}
38+
39+
- name: Run Pytest inside Docker container
40+
run: |
41+
docker run --rm ${{ matrix.service }} pytest
42+
43+
deploy:
44+
needs: build-and-test
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Deploy Docker images (Placeholder)
48+
run: echo "Deploying Docker images"

0 commit comments

Comments
 (0)