feat : initial PostgreSQL infrastructure setup

- docker-compose with postgres:16-alpine
- Init script to create databases (SIRH + Ferme, prod + recette)
- Deploy script with readiness check
- Backup script with rotation (keeps last 7)
- Auto-tag CI workflow
- Full deployment documentation
This commit is contained in:
2026-03-31 10:51:33 +02:00
commit 9c74eb9114
9 changed files with 280 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
name: Auto Tag
on:
push:
branches:
- main
jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.REGISTRY_TOKEN }}
persist-credentials: true
- name: Create next tag
shell: bash
run: |
set -euo pipefail
if git tag --points-at HEAD | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "Tag already exists on this commit. Skipping."
exit 0
fi
last_tag="$(git tag -l 'v*' --sort=-v:refname | head -n1 || true)"
if [ -z "$last_tag" ]; then
version="0.1.0"
else
base="${last_tag#v}"
IFS='.' read -r major minor patch <<< "$base"
version="${major}.${minor}.$((patch + 1))"
fi
tag="v$version"
git config user.name "gitea-actions"
git config user.email "gitea-actions@local"
git tag "$tag"
git push origin "$tag"
echo "Tagged: $tag"