From 98ed11a77646cb935ad0f1c0cc963d2a493782f8 Mon Sep 17 00:00:00 2001 From: Leon Morival Date: Fri, 10 Jul 2026 21:59:07 +0200 Subject: [PATCH] feat: ci/cd --- .gitea/workflows/cd.yml | 45 +++++++++++++++++++++++++++ .gitea/workflows/ci.yml | 65 ++++++++++++++++++++++++++++++++++++++ .idea/landing-server.iml | 9 ++++++ .idea/modules.xml | 8 +++++ app/globals.css | 67 +++++++++++++++++++++++++++++++++++++--- compose.prod.yaml | 26 ++++++++++++++++ 6 files changed, 216 insertions(+), 4 deletions(-) create mode 100644 .gitea/workflows/cd.yml create mode 100644 .gitea/workflows/ci.yml create mode 100644 .idea/landing-server.iml create mode 100644 .idea/modules.xml create mode 100644 compose.prod.yaml diff --git a/.gitea/workflows/cd.yml b/.gitea/workflows/cd.yml new file mode 100644 index 0000000..e356c98 --- /dev/null +++ b/.gitea/workflows/cd.yml @@ -0,0 +1,45 @@ +name: CD + +on: + workflow_run: + workflows: + - CI + branches: + - main + types: + - completed + +jobs: + deploy: + name: Déploiement production + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + steps: + - name: Configuration SSH + run: | + mkdir -p ~/.ssh + echo "${{ secrets.DEPLOY_SSH_KEY }}" \ + > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + + ssh-keyscan \ + -H "${{ secrets.DEPLOY_HOST }}" \ + >> ~/.ssh/known_hosts + + - name: 🚀 Deploy Docker + run: | + ssh \ + -i ~/.ssh/id_ed25519 \ + ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} << 'EOF' + set -e + + echo "Projet" + cd /data/docker/landing-web + + echo "Pull nouvelle image" + docker compose pull + + echo "Redémarrage" + docker compose up -d + + EOF diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..f422eb0 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,65 @@ +name: CI + +on: + push: + branches: + - main + - develop + + pull_request: + branches: + - main + +jobs: + lint: + name: 🔍 Lint & Type Check + runs-on: ubuntu-latest + steps: + - name: 📥 Checkout + uses: actions/checkout@v4 + + - name: 🟢 Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: 📦 Cache node_modules + uses: actions/cache@v4 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm- + + - name: 📥 Install dependencies + run: npm ci + + - name: 🔍 Lint + run: npm run lint + + docker: + name: 🐳 Build & Push Image + needs: lint + if: ${{ github.ref == 'refs/heads/main' }} + runs-on: ubuntu-latest + steps: + - name: 📥 Checkout + uses: actions/checkout@v4 + + - name: 🔐 Login Registry Gitea + run: | + docker login git.leonmorival.xyz \ + -u "${{ secrets.REGISTRY_USER }}" \ + -p "${{ secrets.REGISTRY_PASSWORD }}" + + - name: 🏗️ Build image + run: | + docker build \ + -t git.leonmorival.xyz/leonm/landing-server:latest \ + -t git.leonmorival.xyz/leonm/landing-server:${{ github.sha }} \ + . + + - name: 📤 Push image + run: | + docker push git.leonmorival.xyz/leonm/landing-server:latest + docker push git.leonmorival.xyz/leonm/landing-server:${{ github.sha }} diff --git a/.idea/landing-server.iml b/.idea/landing-server.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/landing-server.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..16851fd --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/app/globals.css b/app/globals.css index 0ed05d9..d0e57e2 100644 --- a/app/globals.css +++ b/app/globals.css @@ -82,6 +82,11 @@ svg { } .stellar-page::before { + --star-opacity-high: 1; + --star-opacity-low: 0.68; + --star-opacity-mid: 0.78; + + inset: -260px -160px; background-image: radial-gradient(circle, rgb(255 255 255 / 90%) 1px, transparent 1.5px), radial-gradient(circle, rgb(0 231 255 / 65%) 1px, transparent 1.5px), @@ -94,14 +99,22 @@ svg { 86px 86px, 142px 142px, 230px 230px; - animation: star-drift 120s linear infinite; + opacity: 0.82; + animation: + star-drift 105s linear infinite, + star-twinkle 5.6s ease-in-out infinite alternate; + will-change: transform, opacity, filter; } .stellar-page::after { background: + radial-gradient(circle, rgb(255 255 255 / 70%) 1px, transparent 1.6px) 12px 22px / 166px 166px, + radial-gradient(circle, rgb(255 213 74 / 38%) 1px, transparent 1.8px) 72px 108px / 270px 270px, linear-gradient(180deg, transparent 0%, rgb(0 231 255 / 6%) 58%, rgb(51 232 121 / 10%) 100%), radial-gradient(ellipse at 30% 80%, rgb(139 77 255 / 18%), transparent 38%), radial-gradient(ellipse at 80% 70%, rgb(0 231 255 / 13%), transparent 32%); + animation: star-glow 12s ease-in-out infinite alternate; + will-change: opacity; } .home-shell { @@ -510,13 +523,21 @@ svg { } .astroneer-hero::before { + --star-opacity-high: 0.66; + --star-opacity-low: 0.42; + --star-opacity-mid: 0.5; + position: absolute; - inset: 0; + inset: -180px; background: radial-gradient(circle, rgb(255 255 255 / 80%) 1px, transparent 1.5px) 0 0 / 96px 96px, radial-gradient(circle, rgb(109 244 255 / 65%) 1px, transparent 1.5px) 44px 18px / 148px 148px; content: ""; opacity: 0.55; + animation: + astroneer-star-drift 92s linear infinite, + star-twinkle 6.5s ease-in-out infinite alternate; + will-change: transform, opacity, filter; } .astroneer-hero::after { @@ -1079,11 +1100,49 @@ h2.pixel-heading { @keyframes star-drift { from { - transform: translateY(0); + transform: translate3d(0, 0, 0); } to { - transform: translateY(-220px); + transform: translate3d(-120px, -220px, 0); + } +} + +@keyframes astroneer-star-drift { + from { + transform: translate3d(0, 0, 0); + } + + to { + transform: translate3d(-90px, -180px, 0); + } +} + +@keyframes star-twinkle { + 0%, + 100% { + filter: brightness(0.92); + opacity: var(--star-opacity-low, 0.68); + } + + 45% { + filter: brightness(1.28); + opacity: var(--star-opacity-high, 1); + } + + 72% { + filter: brightness(1.05); + opacity: var(--star-opacity-mid, 0.78); + } +} + +@keyframes star-glow { + from { + opacity: 0.78; + } + + to { + opacity: 1; } } diff --git a/compose.prod.yaml b/compose.prod.yaml new file mode 100644 index 0000000..18ae626 --- /dev/null +++ b/compose.prod.yaml @@ -0,0 +1,26 @@ +services: + landing-server: + image: git.leonmorival.xyz/leonm/landing-server:latest + container_name: landing-server + restart: unless-stopped + + env_file: + - .env + + expose: + - "3000" + + healthcheck: + test: ["CMD-SHELL", "wget -q --spider http://127.0.0.1:3000/ || exit 1"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 20s + + networks: + - proxy + +networks: + proxy: + external: true + name: proxy