mirror of
https://github.com/m1ngsama/TNT.git
synced 2026-02-08 08:54:05 +00:00
Send keepalive every 30s to prevent NAT/firewall from silently dropping idle SSH connections. Add deploy workflow that auto-deploys to production server after CI passes on main.
45 lines
946 B
YAML
45 lines
946 B
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libssh-dev
|
|
|
|
- name: Build
|
|
run: make
|
|
|
|
- name: Build with AddressSanitizer
|
|
run: make asan
|
|
|
|
- name: Run tests
|
|
run: |
|
|
make test
|
|
cd tests
|
|
./test_security_features.sh
|
|
|
|
deploy:
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Deploy to production
|
|
uses: appleboy/ssh-action@v1
|
|
with:
|
|
host: ${{ secrets.SERVER_HOST }}
|
|
username: ${{ secrets.SERVER_USER }}
|
|
key: ${{ secrets.SERVER_SSH_KEY }}
|
|
script: |
|
|
cd /home/admin/repo/tnt
|
|
git pull origin main
|
|
make clean && make release
|
|
cp tnt /home/admin/tnt/tnt
|
|
sudo systemctl restart tnt
|