From 905ea252be5f7abda919d2d808dfe4292ab9d37c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Rodrigo?= Date: Thu, 18 Apr 2024 19:04:43 +0200 Subject: [PATCH] CI: deploy to dev server --- .github/workflows/ci.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 97928b7..c1535d0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,3 +25,31 @@ jobs: - run: yarn typecheck - run: yarn lint - run: yarn build + + deploy_dev: + needs: + - build + if: github.ref == 'refs/heads/develop' + name: Deploy Dev + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎 + uses: actions/checkout@v4 + + - name: Deploy + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{vars.DEPLOY_SSH_HOST}} + username: ${{vars.DEPLOY_SSH_USERNAME}} + key: ${{secrets.DEPLOY_SSH_KEY_DEV}} + port: 2222 + script: | + echo -n 'Deployment started at: ' && + date -u && + cd ${{vars.DEPLOY_SSH_PATH}} && + git fetch && + git checkout -f origin/develop && + docker-compose build && + docker-compose up -d && + echo -n 'Deployment completed at: ' && + date -u