From c676411e8c95ed80acb0ba5a020623e3c7bc3768 Mon Sep 17 00:00:00 2001 From: Arthur Date: Sat, 13 Sep 2025 23:13:50 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9organisation=20du=20script=20de=20d?= =?UTF-8?q?=C3=A9ploiement=20:=20d=C3=A9placement=20de=20la=20cr=C3=A9atio?= =?UTF-8?q?n=20du=20fichier=20.env=20apr=C3=A8s=20la=20v=C3=A9rification?= =?UTF-8?q?=20du=20d=C3=A9p=C3=B4t=20Git?= 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 "