The following steps assume you are working on a Linux machine.
On your local machine, generate a new SSH key by running:
ssh-keygen -t ed25519 -f ~/.ssh/deploy_key
Copy the generated public SSH key to your server (the one where the website will run) by using the following command:
ssh-copy-id -i ~/.ssh/deploy_key.pub user@host
Go to your GitHub repository and navigate to:
Settings -> Secrets and variables -> Actions -> New repository secret.
Add the following secrets:
PROJECT_PATH
: The absolute path where you cloned your repository on the remote server (e.g., /home/debian/urpagin-dot-net/
).SSH_USER
: The username used to log in to your remote server.SSH_HOST
: The IP address of the remote server.SSH_PRIVATE_KEY
: On your local machine, copy the contents of the ~/.ssh/deploy_key
file, which contains the private SSH key.On your remote server, run the build_and_run.sh
script to start the project.
From this point onward, any git push
action to the master
branch will automatically trigger the build_and_run.sh
script, via SSH, to update the website.
On your remote server, follow these steps:
Clone the repository:
git clone https://github.com/Urpagin/urpagin-dot-net.git
Navigate to the project directory:
cd urpagin-dot-net/
Make the build_and_run.sh
script executable:
chmod +x build_and_run.sh
Run the script:
./build_and_run.sh
Start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
To create a production version of your app:
npm run build
You can preview the production build with npm run preview
.
To deploy your app, you may need to install an adapter for your target environment.