Update README.MD #3
This file contains hidden or 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: 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 }}" |