Add Renovate config, versioned image publishing, and pinned prod requirements
CI / build-and-scan (push) Successful in 43s

This commit is contained in:
Djeex
2026-08-22 12:17:59 +02:00
parent a72b486b3b
commit 5eafd7c7cc
7 changed files with 175 additions and 10 deletions
+37 -2
View File
@@ -14,6 +14,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build Docker image
run: |
@@ -43,7 +45,7 @@ jobs:
- name: Check deprecation warnings
run: |
docker run --rm adguard-cidre:ci python -W error::DeprecationWarning -c "import blocklist_scheduler" 2>&1 | tee deprecation.log || true
docker run --rm --entrypoint python adguard-cidre:ci -W error::DeprecationWarning -c "import blocklist_scheduler" 2>&1 | tee deprecation.log || true
if grep -qi "deprecat" deprecation.log; then
echo "::warning::Deprecation warning detected, check logs"
fi
@@ -60,4 +62,37 @@ jobs:
docker run --rm \
-e DOCKER_HOST=tcp://dockerhost:2375 \
--add-host=dockerhost:host-gateway \
aquasec/trivy:0.74.0 image --exit-code 0 --severity HIGH adguard-cidre:ci
aquasec/trivy:0.74.0 image --exit-code 0 --severity HIGH adguard-cidre:ci
- name: Publish tagged image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
BEFORE="${{ github.event.before }}"
if [ -n "$BEFORE" ] && [ "$BEFORE" != "0000000000000000000000000000000000000000" ] && git cat-file -e "$BEFORE" 2>/dev/null; then
CHANGED=$(git diff --name-only "$BEFORE" "${{ github.sha }}")
else
CHANGED=$(git diff --name-only HEAD~1 HEAD)
fi
echo "Changed files:"
echo "$CHANGED"
if ! echo "$CHANGED" | grep -qE '^(Dockerfile|blocklist_scheduler\.py|VERSION)$'; then
echo "No container-relevant file changed, skipping publish."
exit 0
fi
IMAGE=git.djeex.fr/djeex/adguard-cidre
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.djeex.fr -u Djeex --password-stdin
# Retag the already-built, already-scanned image — never rebuild for publish,
# so what ships is byte-for-byte what Trivy just scanned.
docker tag adguard-cidre:ci "$IMAGE:latest"
docker push "$IMAGE:latest"
if echo "$CHANGED" | grep -qE '^VERSION$'; then
VERSION=$(tr -d '[:space:]' < VERSION)
docker tag adguard-cidre:ci "$IMAGE:$VERSION"
docker push "$IMAGE:$VERSION"
else
echo "VERSION unchanged, skipping versioned tag to avoid overwriting an existing release."
fi