Skip to content

Commit

Permalink
Test Automatic Deployments via Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Owais Shariff committed Jun 8, 2024
1 parent d474d84 commit 5f40c4e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
MONGODB_URL=
ADMIN_USERNAME=
ADMIN_PASSWORD=
ADMIN_PASSWORD=


8 changes: 7 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5f40c4e

Please sign in to comment.