Skip to content

fix deploy dev

fix deploy dev #88

Workflow file for this run

name: Deploy to Server
on:
push:
branches:
- develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Executing remote ssh commands to deploy the application
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ~/projects/uniride
if [ -d "./Uniride-authService" ]; then
cd Uniride-authService
git fetch
git pull origin develop
git checkout develop
else
git clone https://${{ secrets.TOKEN_REPO }}:[email protected]/NoSleepFullBuild/Uniride-authService.git
cd Uniride-authService
git fetch
git checkout develop
fi
if [ ! -f ".env" ]; then
touch .env
else
rm .env
touch .env
fi
echo "PORT=${{ secrets.AUTH_PORT_DEV }}" >> .env
echo "DB_HOST=${{ secrets.DB_HOST }}" >> .env
echo "DB_PORT=${{ secrets.DB_AUTH_PORT_DEV }}" >> .env
echo "DB_NAME=${{ secrets.DB_NAME_DEV }}" >> .env
echo "DB_USER=${{ secrets.DB_USER }}" >> .env
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env
echo "TOKEN_REPO=${{ secrets.TOKEN_REPO }}" >> .env
# Correction : Assurez-vous que la version de Node.js est vérifiée dans le conteneur Docker et non sur le serveur hôte
docker-compose up -d --build