From 36082d504c34abdeaaf66689e576a6878b6d21c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Niemel=C3=A4?= Date: Sun, 18 Aug 2024 18:01:11 +0200 Subject: [PATCH] Added deploy script --- .github/workflows/deploy.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 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..c0c4566 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,24 @@ +name: Deploy to server + +on: + push: + branches: + - main + +job: + deploy: + name: Deploy to server + runs-on: ubuntu-latest + + steps: + - uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.SSH_KEY }} + port: 22 + script: | + cd /dockers/KU-courses + git pull + git switch main + docker compose up -d --build