Adding a command to Hugo deploy

Hello,

I use the " Deployment with Rsync" function Deployment with Rsync | Hugo to generate my Hugo blog and upload it to my server and it is working fine.

I wish to add a command in the deploy script. I compress .xml, .txt, .css, .csv, .html files in the public folder so that they can be used by nginx (I did the set up in nginx on my server).

The command is:

static-compress -c zopfli -e gz -j 16 "**/*.svg" "**/*.html" "**/*.csv" "**/*.css" "**/*.txt" "**/*.xml"

It uses static-compress GitHub - mqudsi/static-compress: A utility for creating a compressed copy of all files in a tree and it works fine.

Now I would like to incorporate this command in the deploy script so that when I do ./deploy files are generated in my public folder, then compressed using the above command then uploaded to my server with rsync.

Thank you for any help or suggestions.