feat: enhance CI/CD pipeline with build and push steps for Docker images
Some checks failed
CI/CD Pipeline / test (push) Successful in 18s
CI/CD Pipeline / build (push) Successful in 16s
CI/CD Pipeline / push (push) Failing after 5s

This commit is contained in:
2025-11-01 19:04:05 +01:00
parent 2238a286d4
commit a51d500777
2 changed files with 27 additions and 6 deletions

View File

@@ -32,6 +32,13 @@ jobs:
# run: |
# python -m flake8 web/ tests/ --max-line-length=120
build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build Docker image
run: |
docker build -t jobs-app .
@@ -40,6 +47,23 @@ jobs:
run: |
docker run --rm jobs-app python -m pytest tests/ -v
push:
runs-on: ubuntu-latest
needs: [build, test]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Push Docker image to gitea registry
uses: docker/build-push-action@v4
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
with:
context: .
push: true
tags: git.allucanget.biz/allucanget/jobs-app:latest
# deploy:
# runs-on: ubuntu-latest
# needs: test

View File

@@ -6,13 +6,10 @@ ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV FLASK_ENV=production
ENV FLASK_SECRET=production-secret-change-me
ENV APT_CACHER_NG=http://192.168.88.14:3142
# Find location of apt sources list and change to a faster mirror
RUN [ -f /etc/apt/sources.list ] && \
echo "/etc/apt/sources.list exists, proceeding to modify it." \
&& sed -i 's|http://deb.debian.org/debian|https://mirror.init7.net/debian|g' /etc/apt/sources.list \
|| \
(echo "/etc/apt/sources.list does not exist, exiting.")
# Add apt-cacher-ng configuration
RUN echo 'Acquire::http { Proxy "'"$APT_CACHER_NG"'/"; };' > /etc/apt/apt.conf.d/01proxy
# Install system dependencies
RUN apt-get update && apt-get install -y \