Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ------------------------------- Builder Satge -------------------------------

# Build stage (with dev tools for linting, testing, etc.)
FROM python:3.13-slim-bookworm AS builder
# 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
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates && \
Expand Down Expand Up @@ -29,10 +29,11 @@ RUN uv sync
# Copy the rest of the project
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
Expand Down