Skip to content

Commit

Permalink
Update backend-ec2-deploy.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Haroun Alarabi <[email protected]>
  • Loading branch information
HarounAlarabi authored Feb 6, 2024
1 parent 617bdf5 commit d8f9024
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/backend-ec2-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Deploy to EC2

on:
push:
push:
branches:
- Level--300

jobs:
deploy:
name: Deploy to EC2
Expand All @@ -15,24 +16,27 @@ jobs:

- name: Build and Test
run: |
# Add your build and test commands here
- name: Remove Previous Deployment
uses: easingthemes/ssh-deploy@main
with:
REMOTE_HOST: ${{ secrets.HOST_DNS }}
REMOTE_USER: ${{ secrets.USERNAME }}
REMOTE_PORT: 22
ARGS: "-avz --delete"

TARGET: "/home/ubuntu"
env:
SSH_PRIVATE_KEY: ${{ secrets.EC2_SSH_KEY }}

- name: Deploy to EC2
uses: easingthemes/ssh-deploy@main
with:
local-path: server
ARGS: "-avz"
TARGET: "/home/ubuntu"
env:
SSH_PRIVATE_KEY: ${{ secrets.EC2_SSH_KEY }}
REMOTE_HOST: ${{ secrets.HOST_DNS }}
REMOTE_USER: ${{ secrets.USERNAME }}
REMOTE_PORT: 22
REMOTE_SCRIPT: 'rm -rf /home/ubuntu'

# - name: Deploy to EC2
# uses: easingthemes/ssh-deploy@main
# with:
# local-path: server
# env:
# SSH_PRIVATE_KEY: ${{ secrets.EC2_SSH_KEY }}
# REMOTE_HOST: ${{ secrets.HOST_DNS }}
# REMOTE_USER: ${{ secrets.USERNAME }}



0 comments on commit d8f9024

Please sign in to comment.