Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

REPO_DIR="/home/loki/www/gunlinux.ru"
BRANCH="master"

# Navigate to the repository directory
cd $REPO_DIR || exit

# Fetch and reset changes from the remote repository
git fetch --all
git reset --hard origin/$BRANCH

# Optionally run build or install commands here if needed
# e.g., npm install, yarn install for Node.js projects

# Restart services using sudo
sudo systemctl restart gunlinux.ru

echo "Deployment completed successfully."
26 changes: 26 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy to Server

on:
push:
branches:
- master # or any other branch you want to deploy from

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: test secrests
run: |
echo ${{ secrets.USERNAME }}

- name: Set up SSH
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: |
${{ secrets.PRIVATE_KEY_SSH }}

- name: Deploy to Server
run: |
ssh -o "StrictHostKeyChecking=no" "loki@gunlinux.ru" 'bash -s' < .github/deploy.sh