Skip to content

Commit

Permalink
Merge pull request #16 from matheusdoedev/feat/aws
Browse files Browse the repository at this point in the history
chore: it updates deploy workflow
  • Loading branch information
matheusdoedev authored Sep 28, 2023
2 parents c3cd143 + 36444aa commit c97f632
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Acessing EC2 instance
run: ssh -i ${{ secrets.SSH_KEY }} ${{ secrets.AWS_EC2_USERNAME }}@${{ secrets.AWS_EC2_HOST }}

- name: Pulling docker image
run: sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ env.CONTAINER_NAME }}

- name: Running container
run: sudo docker run -d -p 80:80 ${{ secrets.DOCKER_USERNAME }}/${{ env.CONTAINER_NAME }}
- name: SSH Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.AWS_EC2_HOST }}
username: ${{ secrets.AWS_EC2_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ env.CONTAINER_NAME }}
sudo docker run -d -p 80:80 ${{ secrets.DOCKER_USERNAME }}/${{ env.CONTAINER_NAME }}

0 comments on commit c97f632

Please sign in to comment.