How I automatically deploy my personal website

24年 9月 26日 Thursday
114 words
1 minutes

Make your workflow more convenient!

bash
#!/usr/bin/bash

cd ~/software/my-code/personal-website &&
pnpm run build &&
scp -r ./dist serper:~/dist &&
ssh serper "rm -rvf ~/personal-web && mv -v ~/dist ~/personal-web"

note that serper is configured on ~/.ssh/config file, see this post for how to configure it.

It's pretty simple script, if you have any suggestion, please leave a constructive comments ^^

I execute the script manually through a terminal, you might ask: "why not trigger it automatically on git hook or github CI/CD pipeline?" well... sometimes I don't want to auto build when commit or push changes to remote repository, and it's more convenient for me presonally to do it manually :)

You can fork the site from this github repository

Title:How I automatically deploy my personal website

Author:ReYuki

Link:https://www.reyuki.site/posts/deploy-script [copy]

Last updated:


This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. You are free to share and adapt it, as long as you give appropriate credit, don’t use it for commercial purposes, and distribute your contributions under the same license. Provided under license CC BY-NC-SA 4.0