Skip to content

Commit

Permalink
Merge pull request #2 from BananasDev0/master
Browse files Browse the repository at this point in the history
Create dev.yml
  • Loading branch information
BananasDev0 authored Feb 23, 2024
2 parents 7bb1a81 + 20041c1 commit 6cf4788
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Despliegue en EC2

on:
push:
branches:
- dev # Cambia 'dev' por la rama que desees

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout código
uses: actions/checkout@v4

- name: Copiar archivos al servidor
uses: appleboy/[email protected]
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
source: "."
target: "projects/RefaDiazFrontEnd"

- name: Ejecutar comandos remotos
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd projects/RefaDiazFrontEnd
npm install
npm run build
pm2 restart RefaDiazApp

0 comments on commit 6cf4788

Please sign in to comment.