Skip to content

Commit

Permalink
SCP instead of scp-action
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloccangucu committed Sep 24, 2024
1 parent 1f34fa8 commit c2275bb
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,10 @@ jobs:
- name: Debug PEM file content
run: cat my-wesite-server.pem

- name: Copy files to EC2
uses: appleboy/[email protected]
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: my-wesite-server.pem
port: 22
source: "build/*"
target: "/var/www/html/"
- name: Copy files to EC2 using SCP
run: |
scp -i my-website-server.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r build/* ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }}:/var/www/html/
- name: Restart Nginx
run: |
ssh -i my-wesite-server.pem -o StrictHostKeyChecking=no ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} "sudo systemctl reload nginx"
ssh -i my-website-server.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} "sudo systemctl reload nginx"

0 comments on commit c2275bb

Please sign in to comment.