mirror of
https://github.com/arthur-pbty/syncfilm.git
synced 2026-06-03 15:07:40 +02:00
Réorganiser la préparation du contenu du fichier .env dans le workflow de déploiement
This commit is contained in:
@@ -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
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user