Merge pull request #344 from christianlouis/copilot/remove-automatic-production-push

ci: fix lint, drop webhook deploy, add ArgoCD GitOps preprod sync
This commit is contained in:
Christian Krakau-Louis
2026-02-21 10:45:19 +01:00
committed by GitHub
3 changed files with 39 additions and 6 deletions
+37 -5
View File
@@ -210,16 +210,48 @@ jobs:
cache-to: type=gha,mode=max
# ══════════════════════════════════════════════════════════════════════════
# Stage 4: Deploy (only after build succeeds, only on main branch)
# Stage 4: Update preprod K8s manifest (ArgoCD GitOps, only on main)
# ══════════════════════════════════════════════════════════════════════════
deploy:
name: Deploy to Production
update-k8s-manifest:
name: Update Preprod K8s Manifest
runs-on: ubuntu-latest
needs: [build]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- name: Call Deployment Webhook
- name: Compute image tag
id: tag
run: |
curl -X POST https://docker2.kuechenserver.org/api/stacks/webhooks/960c7d8e-97ec-4175-a8dc-73f037b02349
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
echo "image=ghcr.io/${{ github.repository_owner }}/docuelevate:main-${SHORT_SHA}" >> "$GITHUB_OUTPUT"
echo "tag=main-${SHORT_SHA}" >> "$GITHUB_OUTPUT"
- name: Checkout k8s-cluster-state
uses: actions/checkout@v4
with:
repository: christianlouis/k8s-cluster-state
token: ${{ secrets.GH_PAT }}
path: k8s-cluster-state
- name: Update image tag in preprod manifest
uses: mikefarah/yq@v4.44.6
env:
IMAGE: ${{ steps.tag.outputs.image }}
with:
cmd: |
yq -i '(.. | select(tag == "!!str") | select(test("^(ghcr\\.io/christianlouis/docuelevate|christianlouis/docuelevate):"))) = strenv(IMAGE)' \
k8s-cluster-state/apps/docuelevate/preprod/docuelevate-stack.yaml
- name: Commit and push
run: |
cd k8s-cluster-state
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add apps/docuelevate/preprod/docuelevate-stack.yaml
if git diff --staged --quiet; then
echo "No changes to commit -- image tag already up to date"
else
git commit -m "chore(preprod): update docuelevate image to ${{ steps.tag.outputs.tag }}"
git push
fi
+1
View File
@@ -172,6 +172,7 @@ def _db_records(db: Session, workdir_base: Path) -> List[Dict[str, Any]]:
"""
rows = []
for rec in db.query(FileRecord).order_by(FileRecord.id.desc()).all():
def _check(p: str | None) -> Dict[str, Any]:
if not p:
return {"path": None, "exists": None, "rel": None}
+1 -1
View File
@@ -352,7 +352,7 @@ class TestOuterQuoteStripping:
def test_mismatched_quotes_not_stripped(self):
"""Mismatched quotes (open with one type, close with another) are NOT stripped."""
raw = '"sqlite:///test.db\''
raw = "\"sqlite:///test.db'"
config = Settings(
database_url=raw,
**_BASE_KWARGS,