composer archive
is likely not to help you, because this command creates an archive of a defined version of a package.
You probably want to upload the whole working application, and not only one package. You should create a little script that will create the archive file for you, which should do:
- checkout the application from the repository in a new directory
- run
composer install --no-dev
to install all required dependencies without dev-dependencies
- optionally delete files that are not necessary on the server, like documentation, the
.git
folder, and other stuff
- create the archive file from all these files
- optionally upload that archive to the target server and unarchive there
- optionally check basic functions and switch to the new uploaded version on the server