Release / build (push) Successful in 1m25s
Merges RSS/Atom/JSON sources into one feed. A local OpenAI-compatible LLM filters articles against plain-language negatives, groups reports of the same event into stories, and writes a one-sentence Croatian title and a description of at most two sentences for each story. Original articles are only ever linked as published. - Pipeline: fetch, dedupe, Readability extraction, keyword + AI triage with exceptions and learned corrections, embedding clustering with an LLM same-event check, summary with format check and Croatian language guard, regeneration for developing stories - Neutral importance scoring with coverage boost and manual override - Feed controls: Live or Editions, daily/category/source limits, breaking bypass, 7-day preview; daily digest with offline fallback - Circuit breaker that pauses and resumes the queue on LLM outages - Express 5 + node:sqlite server, React 19 + Vite web UI (dark, PWA) - Feeds under /feeds/ for a single Pangolin rule; optional feed token - Dockerfile runs typecheck and the full test suite before building; Gitea workflow builds, scans and pushes the image Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
100 lines
3.6 KiB
YAML
100 lines
3.6 KiB
YAML
# Build (and publish, on main pushes) the RSSFeed image via Gitea Actions.
|
|
# The Dockerfile's build stage typechecks, runs the full test suite and builds the web UI,
|
|
# so a failing test fails this workflow. Pull-request runs build only, never push.
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
# Serialize main-branch builds so two quick pushes can't race on `:latest`.
|
|
concurrency:
|
|
group: release-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
env:
|
|
REGISTRY: git.mariosem.es
|
|
IMAGE: msemes/rssfeed
|
|
|
|
jobs:
|
|
build:
|
|
# The registered act_runner talks to the host Docker daemon through /var/run/docker.sock.
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Checkout
|
|
# Mirrored into Gitea so the runner doesn't depend on reaching public github.com.
|
|
uses: https://git.mariosem.es/actions/checkout@v4
|
|
|
|
- name: Compute short git SHA
|
|
id: meta
|
|
run: echo "sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Log in to Gitea container registry
|
|
if: github.event_name == 'push'
|
|
uses: https://git.mariosem.es/docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
# Personal Access Token with write:package scope, stored as repo secret REGISTRY_TOKEN.
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build image
|
|
env:
|
|
DOCKER_BUILDKIT: "1"
|
|
run: |
|
|
TAGS="-t ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.meta.outputs.sha }}"
|
|
if [ "${{ github.event_name }}" = "push" ]; then
|
|
TAGS="$TAGS -t ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest"
|
|
fi
|
|
docker build --build-arg GIT_SHA=${{ steps.meta.outputs.sha }} $TAGS .
|
|
|
|
- name: Scan image for CVEs (blocking gate)
|
|
if: github.event_name == 'push'
|
|
# Gate on what this repo controls: our /app deps and the Debian OS layer. The base
|
|
# image's own npm/corepack/yarn are skipped (the runtime never runs them).
|
|
run: |
|
|
docker run --rm \
|
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
|
-v "$HOME/.cache/trivy":/root/.cache/ \
|
|
aquasec/trivy:latest image \
|
|
--scanners vuln \
|
|
--skip-dirs /usr/local/lib/node_modules \
|
|
--skip-dirs '/opt/yarn-*' \
|
|
--exit-code 1 \
|
|
--severity HIGH,CRITICAL \
|
|
--ignore-unfixed \
|
|
--no-progress \
|
|
${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.meta.outputs.sha }}
|
|
|
|
- name: Push :sha and :latest
|
|
if: github.event_name == 'push'
|
|
run: |
|
|
set -e
|
|
retry_push() {
|
|
local target=$1
|
|
for attempt in 1 2 3; do
|
|
if docker push "$target"; then
|
|
return 0
|
|
fi
|
|
if [ "$attempt" -lt 3 ]; then
|
|
echo "Push of $target failed (attempt $attempt/3) - retrying in 5s"
|
|
sleep 5
|
|
fi
|
|
done
|
|
echo "Push of $target failed after 3 attempts"
|
|
return 1
|
|
}
|
|
retry_push ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.meta.outputs.sha }}
|
|
retry_push ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
|
|
docker rmi ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.meta.outputs.sha }} || true
|
|
|
|
- name: Clean up the PR build image
|
|
if: github.event_name == 'pull_request'
|
|
run: docker rmi ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.meta.outputs.sha }} || true
|