deploy changes to live server (linux) via scp ... ...
# help-with-umbraco
d
Hey Umbracians, i develop UmbracoCMS at the moment locally on my Macbook, but I got a little server at home which runs Ubuntu ARM. The thing is, if I change something I prepared 2 scripts at the moment:
Copy code
bash
echo "Publishing dotnet"
cd /Users/danieloberlechner/Projekte/2-CSharp/DanielOberlechner
dotnet publish -C Release

echo "This script will initiate to copy all local files to OdroidC2 Server and deploy them accordingly."
scp -r /Users/danieloberlechner/Projekte/2-CSharp/DanielOberlechner/bin/Debug/net7.0/publish/* Server:/var/www/personal_website/

echo "copy umbraco stuff"
scp -r /Users/danieloberlechner/Projekte/2-CSharp/DanielOberlechner/umbraco Server:/var/www/personal_website/

echo "Run update website script"
update-website
This is the big update script, and I got also a smaller one for smaller changes:
Copy code
bash
echo "Updating view files"
scp -r /Users/danieloberlechner/Projekte/2-CSharp/DanielOberlechner/Views 
Server:/var/www/personal_website/

echo "Update wwwroot"
scp -r /Users/danieloberlechner/Projekte/2-CSharp/DanielOberlechner/wwwroot 
Server:/var/www/personal_website/

echo "Update appsettings"
scp -r /Users/danieloberlechner/Projekte/2-CSharp/DanielOberlechner/appsettings* Server:/var/www/personal_website/
It takes about a half a minute if I run the init-website script. But there should be a better way then copying thousands of files every time to the server? should exist ? I have also a other problem: I use smidge at the moment for bundling and I made changes to the Startup.cs but on the live server the additionally added minifcation css and js files are not there, they won't get minified into the bundle I want to. I suppose thats to a issue that I do not copy all important files to the live server. Has anyone of you created a pipeline or a script to update changes to a server? I use everything selfhosted so umbraco cloud etc. is no option for me... Has anyone some hints or a guidline how I can proceed with this the best way?
c
Just thinking out loud, (and I probably shouldn't), but would GitHub Actions solve your issue? AFAIU it does the build and then pushes the results to your server.
d
@Craig100 it would, the problem is I'm not so familiar with dotnet and umbraco therefore I would need before github actions a working shell script, which I could implement later into a github action ... The problem is my shell script is really dirty hand made at the moment and I search for people how automized this step already ... 🙂
c
I didn't write the one I'm using but I notice that the "New WorkFlow" button on GitHub Actions page has a load of examples. Might be helpful. Or maybe someone on here could help.
d
@Craig100 yeah thats good, but where can I get the information which files I have to update for example when I change Startup.cs? Do I have to dotnet publish -c Release everytime, or can I copy simply the bin files or what exact files I have to update at which point is still a big issue ... Is there any documentation out there?
s
> Do I have to dotnet publish -c Release everytime Yes, deploy all the files that get produced from that! Sorry, I have no more info (not a linux expert), but that is exactly what "makes" a published website. For Windows hosting those are exactly the required files that need to be deployed too.