skip to Main Content

I have a problem to deploy a symfony project with github action. I can connect with ssh and execute a git pull or a php bin/console doctrine:migrations:migrate, but it’s impossible to use the compose command.

I followed the various explanations of ionos (https://www.ionos.com/digitalguide/websites/web-development/using-php-composer-in-ionos-webhosting-packages/) but github actions tells me "Could not open input file: composer.phar".

Here is my script if anyone has an idea

name: CD
 on:
   push:
     branches: [ develop ]

 jobs:
   deploy:
     runs-on: ubuntu-latest
     steps:
       - name: SSH and Deploy
         uses: appleboy/ssh-action@master
         with:
           host: ${{ secrets.APP_HOST }}
           username: ${{ secrets.APP_USER }}
           password: ${{ secrets.APP_PASS }}
           port: 22
           script: |
             cd /homepages/14/d800745077/htdocs/clickandbuilds/dashJob
             git pull
             /usr/bin/php8.0-cli composer.phar i
             /usr/bin/php8.0-cli bin/console d:m:m -n

2

Answers


  1. It depends on your current working directory.
    If the repository has composer.phar in your remote repository you just pulled, then the command would work.

    If not, replace it with a find . -name "composer.phar" to check where that file is in the repository.

    Login or Signup to reply.
  2. IONOS is offering a tooling named Deploy Now that should ease your setup. For PHP you can find docs here.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search