Skip to content

Commit

Permalink
Create docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
vishavsingla authored Sep 4, 2024
1 parent c1c9c22 commit ff947c7
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI/CD Pipeline

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
service:
- Hate_Speech
- Click-Bait
- Security-Header
- SSL
- FakeNewsAPI
- ImageAPI
- News_Origin
- ReportAPI

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.10

- name: Build Docker image for ${{ matrix.service }}
run: |
docker build -t ${{ matrix.service }} ./server/${{ matrix.service }}
- name: Run Pytest inside Docker container
run: |
docker run --rm ${{ matrix.service }} pytest
deploy:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: Deploy Docker images (Placeholder)
run: echo "Deploying Docker images"

0 comments on commit ff947c7

Please sign in to comment.