mirror of
https://github.com/arthur-pbty/links.git
synced 2026-08-01 20:29:27 +02:00
Réorganisation du script de déploiement : déplacement de la création du fichier .env après la vérification du dépôt Git
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