From 78392e498ab1c48e0bf3120dad131a561249945d Mon Sep 17 00:00:00 2001 From: Diego Andres Ramirez Mejia <157324739+DiegoAndresRamirez@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:13:49 -0500 Subject: [PATCH] Update the Pipeline to test the ssh connection --- .github/workflows/deploy-main.yml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy-main.yml b/.github/workflows/deploy-main.yml index 67f222a..0c90fb1 100644 --- a/.github/workflows/deploy-main.yml +++ b/.github/workflows/deploy-main.yml @@ -5,22 +5,15 @@ on: branches: [ main ] jobs: - build-and-deploy: + test-connection: runs-on: ubuntu-latest steps: - - name: Executing remote ssh commands using password + - name: Test SSH Connection uses: appleboy/ssh-action@v0.1.6 with: - host: ${{ secrets.HOST_SERVER }} - username: ${{ secrets.USERNAME_SERVER }} - password: ${{ secrets.PASSWORD_SERVER }} - port: ${{ secrets.PORT_SERVER }} + host: ${{ secrets.SERVER_HOST }} + username: ${{ secrets.SERVER_USER }} + password: ${{ secrets.SERVER_PASSWORD }} + port: ${{ secrets.SERVER_PORT }} script: | - cd "${{ secrets.PATH }}" - git pull origin main - git fetch - echo '${{ secrets.ENV_FILE }}' > .env - composer i - composer dump-autoload - php artisan migrate:fresh --seed - php artisan optimize:clear + echo "Connection successful to ${{ secrets.SERVER_HOST }}"