From 56f16b73ae4275210a72f95b5d86212a81464622 Mon Sep 17 00:00:00 2001 From: Thiago Sales <86448522+txiami@users.noreply.github.com> Date: Sat, 1 Jun 2024 23:59:59 -0300 Subject: [PATCH] deploy automatico v1 --- .github/workflows/deploy.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..49fc394 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,31 @@ +name: Deploy to EC2 + +on: + push: + branches: + - develop + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Deploy to EC2 + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.EC2_HOST }} + username: ${{ secrets.EC2_USERNAME }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + script: | + cd /home/ubuntu/frontend/WallDreams + git pull origin develop + sudo systemctl restart nginx