From 139460dbcf5e7bd785f6b257e63c08e276bfa8cc Mon Sep 17 00:00:00 2001 From: U S A M A H <39458672+usamahz@users.noreply.github.com> Date: Mon, 23 Sep 2024 00:02:04 +0100 Subject: [PATCH] Add Github Actions --- .github/workflows/ci_cd.yml | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/ci_cd.yml diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml new file mode 100644 index 0000000..ac6bb44 --- /dev/null +++ b/.github/workflows/ci_cd.yml @@ -0,0 +1,55 @@ +name: CI/CD Pipeline + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + services: + docker: + image: docker:19.03.12 + options: >- + --privileged + --network host + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Build Docker image + run: | + docker build -t transformer-image . + + train: + runs-on: ubuntu-latest + needs: build # Ensure the build job completes before running this job + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Run training script + run: | + docker run --rm transformer-image python src/train.py + + translate: + runs-on: ubuntu-latest + needs: build # Ensure the build job completes before running this job + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Run translation script + run: | + docker run --rm transformer-image python src/translate.py \ No newline at end of file