From 43d4b9ba163a6e5dd17bad29c292395760c31813 Mon Sep 17 00:00:00 2001 From: Dimeji Salau Date: Sun, 6 Apr 2025 22:16:19 -0600 Subject: [PATCH 1/3] Fix CD to run on push to main --- .github/workflows/ci_cd.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 6e59c68..4412012 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -4,31 +4,30 @@ on: pull_request: branches: - main + push: + branches: + - main jobs: ci: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build and Check (using multi-stage Dockerfile) run: make docker-check-ci cd: needs: ci - if: github.ref == 'refs/heads/main' + if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build prod image run: make docker-build-prod - - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Push prod image run: make docker-push \ No newline at end of file From 726ec5c2c2bf35bd0e66c02a32f8556265f3fc70 Mon Sep 17 00:00:00 2001 From: Dimeji Salau Date: Sun, 6 Apr 2025 22:24:01 -0600 Subject: [PATCH 2/3] Changed base Python image from 3.13 to 3.12 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 02b6498..4f6e25d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # ------------------------------- Builder Satge ------------------------------- # Build stage (with dev tools for linting, testing, etc.) -FROM python:3.13-slim-bookworm AS builder +FROM python:3.12-slim-bookworm AS builder # The installer requires curl (and certificates) to download the release archive RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates && \ @@ -32,7 +32,7 @@ COPY . /app # ------------------------- Production Stage ------------------------- # Final stage (production, lean image) -FROM python:3.13-slim-bookworm AS production +FROM python:3.12-slim-bookworm AS production WORKDIR /app # Prevent Python from writing pyc files and buffering output From 61843842e7c2e41baa5ffd09abb1196d3b2506db Mon Sep 17 00:00:00 2001 From: Dimeji Salau Date: Sun, 6 Apr 2025 22:30:28 -0600 Subject: [PATCH 3/3] Modified Dockerfile - cleaned up too many spaces --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4f6e25d..3541f70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # ------------------------------- Builder Satge ------------------------------- - # Build stage (with dev tools for linting, testing, etc.) +# Build stage (with dev tools for linting, testing, etc.) FROM python:3.12-slim-bookworm AS builder # The installer requires curl (and certificates) to download the release archive @@ -29,6 +29,7 @@ RUN uv sync # Copy the rest of the project COPY . /app + # ------------------------- Production Stage ------------------------- # Final stage (production, lean image)