Merge pull request #27 from BananasDev0/RD-74 #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DEV 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.DEV_EC2_HOST }} | |
username: ${{ secrets.DEV_EC2_USER }} | |
key: ${{ secrets.DEV_SSH_PRIVATE_KEY }} | |
port: 22 | |
source: "." | |
target: "projects/RefaDiazFrontEnd" | |
- name: Ejecutar comandos remotos | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.DEV_EC2_HOST }} | |
username: ${{ secrets.DEV_EC2_USER }} | |
key: ${{ secrets.DEV_SSH_PRIVATE_KEY }} | |
port: 22 | |
script: | | |
cd projects/RefaDiazFrontEnd | |
npm install | |
pm2 restart RefaDiazApp |