This commit is contained in:
33
.gitea/workflows/deploy.yml
Normal file
33
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Deploy to VPS
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest # Use a label matching your runner, e.g., ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Full history for git operations
|
||||||
|
|
||||||
|
- name: Setup SSH
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
ssh-keyscan -H ${{ secrets.DEPLOY_SERVER }} >> ~/.ssh/known_hosts
|
||||||
|
eval "$(ssh-agent -s)"
|
||||||
|
ssh-add ~/.ssh/id_ed25519
|
||||||
|
|
||||||
|
- name: Deploy via Git Pull and Rsync
|
||||||
|
run: |
|
||||||
|
# Pull latest on server
|
||||||
|
ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_SERVER }} "
|
||||||
|
cd ${{ secrets.DEPLOY_PATH }} &&
|
||||||
|
git fetch origin &&
|
||||||
|
git reset --hard origin/master
|
||||||
|
"
|
||||||
2
main.rs
2
main.rs
@@ -15,7 +15,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
crossterm::terminal::Clear(crossterm::terminal::ClearType::All)
|
crossterm::terminal::Clear(crossterm::terminal::ClearType::All)
|
||||||
)?;
|
)?;
|
||||||
execute!(stdout, crossterm::cursor::MoveTo(0, 0))?;
|
execute!(stdout, crossterm::cursor::MoveTo(0, 0))?;
|
||||||
println!("Hello, World!");
|
println!("Wellcome to dcorral.com!");
|
||||||
execute!(stdout, crossterm::cursor::MoveTo(0, 1))?;
|
execute!(stdout, crossterm::cursor::MoveTo(0, 1))?;
|
||||||
println!("Press any key to exit.");
|
println!("Press any key to exit.");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user