-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from BananasDev0/master
Create dev.yml
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
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
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 |