Git pull CI/CD Deploy on server Cloudways

Hi everyone,

In my stage internship of my gitlab-ci.yml CI, I want to automatically send the changes from my repo to my Cloudways server (without using the cloudways manual “deploy via Git”).
my project is in the public_html/
So I do this:

deploy:
    stage: deploy

    script:
       - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
       - eval $(ssh-agent -s)
       - ssh-add <(echo "$SSH_PRIVATE_KEY")
       - mkdir -p ~/.ssh
       - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n 
          $APP_USER@$APP_HOST" > ~/.ssh/config'
       - cd public_html/ && git pull origin main && composer install

   environment:
            name: production
    only:
        - main

The CI is running. everything is OK. But my change are not in production.
Do you have a tip, a good practice?

thanks in advance