I tried to upgrade using these commands :

    composer require magento/product-community-edition 2.2.7 --no-update

    composer update

    rm -rf var/di var/generation
    php bin/magento cache:flush
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento indexer:reindex

  

Everything ran successfully but css and javascript files are not working in the back- and front-end.
I checked the .httaccess files and ran content deploy:
 

    php bin/magento setup:static-content:deploy ar_SA -f

[![Frontend][1]][1]

  [image backend]: https://i.sstatic.net/RMZvU.png


  [1]: https://i.sstatic.net/2MgbI.png