WebServer/.gitea/workflows/deploy.yaml
Aleksey_Skakodub 62fd20182b
Some checks failed
Test Workflow / test (push) Successful in 2s
Deploy to Server / deploy (push) Failing after 6s
****
2025-04-21 17:48:46 -04:00

31 lines
761 B
YAML
Executable File

name: Deploy to Server
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup SSH Key
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }}
- name: Add Known Host
run: ssh-keyscan ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts
- name: Deploy to Server
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} "
sudo cd ${{ secrets.PROJECT_PATH }} &&
git pull origin master &&
docker-compose down --remove-orphans &&
docker-compose up -d --build
"