-
Notifications
You must be signed in to change notification settings - Fork 22
37 lines (31 loc) · 1 KB
/
deploy.yml
File metadata and controls
37 lines (31 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Deploy to VPS
on:
workflow_dispatch: # ← Esto permite lanzarlo manualmente desde la interfaz
push:
branches: [main]
env:
DEPLOY_DIR: ${{ github.actor }} # Usará el nombre de usuario de GitHub automáticamente
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Crear carpeta remota (si no existe)
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.DEPLOY_KEY }}
port: 2222
script: |
mkdir -p /var/www/html/evento/tecuruapan/${{ env.DEPLOY_DIR }}
- name: Subir sitio al VPS
uses: appleboy/scp-action@v0.1.3
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.DEPLOY_KEY }}
port: 2222
source: "./*"
target: "/var/www/html/evento/tecuruapan/${{ env.DEPLOY_DIR }}"