From 5f40c4e9fff0b504ed9f100d4a3e57be2fa59abd Mon Sep 17 00:00:00 2001 From: Owais Shariff Date: Sat, 8 Jun 2024 23:54:04 +0300 Subject: [PATCH] Test Automatic Deployments via Workflows --- .env.template | 4 +++- .github/workflows/deploy.yml | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.env.template b/.env.template index 30a482f..83bc75e 100644 --- a/.env.template +++ b/.env.template @@ -1,3 +1,5 @@ MONGODB_URL= ADMIN_USERNAME= -ADMIN_PASSWORD= \ No newline at end of file +ADMIN_PASSWORD= + + diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 68a94f2..5a148eb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,12 +32,18 @@ jobs: needs: build steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install SSH client + run: sudo apt-get install openssh-client -y + - name: SSH to Droplet and deploy uses: appleboy/ssh-action@master with: host: ${{ secrets.DROPLET_IP }} username: ${{ secrets.DROPLET_USER }} - key: ${{ secrets.DROPLET_KEY }} + password: ${{ secrets.DROPLET_PASSWORD }} script: | docker pull ${{ secrets.DOCKER_USERNAME }}/tryhackme-api:latest docker stop tryhackme-api || true