From 567293c89e50d6521c9c62725b0bdef5e13f31d8 Mon Sep 17 00:00:00 2001 From: Nikita Aksenov Date: Sun, 16 Feb 2025 16:43:33 +0300 Subject: [PATCH] Deploy workflow --- .github/workflows/deploy.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..b9de621 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,27 @@ +name: Deploy to Server + +on: + push: + branches: + - deploy + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Add SSH key + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Deploy to server + run: | + ssh -o StrictHostKeyChecking=no ${{ secrets.USERNAME }}@${{ secrets.SERVER_IP }} " + cd ${{ secrets.PROJECT_PATH }} && + git fetch origin deploy && + git reset --hard origin/deploy + " \ No newline at end of file