Deployment
Deploy Landing Page
Let's create a build by running these commands on your machine:
cd src/ShipDotnet.LandingPage
yarn install
yarn build
Now we need to copy package.json and node_modules to build directory
cp package.json build/package.json
cp -R node_modules build/node_modules
scp -r ./build user@your-ubuntu-ip:/var/www/apps/shipdotnet-landing-page
tar -czvf shipdotnet-landing-page.tar.gz -C build .
Upload your build to the server
scp shipdotnet-landing-page.tar.gz user@your-ubuntu-ip:/var/www/apps/shipdotnet-landing-page
Login in to your server and extract it:
tar -xzvf shipdotnet-landing-page.tar.gz
rm shipdotnet-landing-page.tar.gz
Fun fact : Most java script developers upload the source code and run the build directly on their remote machines - which is not necessary. You can build the project locally and upload only the final build artifacts. It's faster, cleaner, and reduces the risk of leaking environment-specific files or dependencies.
Next:
Run Landing Page