From ad0c45addfb71ce03559d288569c2fc8715863b8 Mon Sep 17 00:00:00 2001 From: Arthur Date: Sat, 13 Sep 2025 23:14:01 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9organiser=20la=20pr=C3=A9paration=20du?= =?UTF-8?q?=20contenu=20du=20fichier=20.env=20dans=20le=20workflow=20de=20?= =?UTF-8?q?d=C3=A9ploiement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c0b1d3f..0b20345 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,7 +16,6 @@ jobs: run: | REPO_NAME=${{ github.event.repository.name }} - # Préparer le contenu du .env (vide si secret non défini) if [ -z "${{ secrets.ENV_FILE }}" ]; then ENV_CONTENT="" else @@ -27,16 +26,17 @@ jobs: mkdir -p /srv/$REPO_NAME cd /srv/$REPO_NAME - # Crée .env seulement si contenu non vide + if [ ! -d .git ]; then + rm -rf ./* # vide le dossier si nécessaire + git clone https://github.com/arthur-pbty-labs/$REPO_NAME . + else + git reset --hard + git pull origin main + fi + if [ -n \"$ENV_CONTENT\" ]; then echo \"$ENV_CONTENT\" > .env fi - if [ ! -d .git ]; then - git clone https://github.com/arthur-pbty-labs/$REPO_NAME . - else - git pull origin main - fi - docker compose up -d --build "