Skip to content

Commit ab444e8

Browse files
committed
all files commit
0 parents  commit ab444e8

File tree

3 files changed

+145
-0
lines changed

3 files changed

+145
-0
lines changed

.github/workflows/deploy.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy to VPS
2+
3+
on:
4+
workflow_dispatch: # ← Esto permite lanzarlo manualmente desde la interfaz
5+
push:
6+
branches: [main]
7+
8+
env:
9+
DEPLOY_DIR: ${{ github.actor }} # Usará el nombre de usuario de GitHub automáticamente
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Crear carpeta remota (si no existe)
20+
uses: appleboy/[email protected]
21+
with:
22+
host: ${{ secrets.VPS_HOST }}
23+
username: ${{ secrets.VPS_USER }}
24+
key: ${{ secrets.DEPLOY_KEY }}
25+
port: 2222
26+
script: |
27+
mkdir -p /var/www/html/evento/tecuruapan/${{ env.DEPLOY_DIR }}
28+
29+
- name: Subir sitio al VPS
30+
uses: appleboy/[email protected]
31+
with:
32+
host: ${{ secrets.VPS_HOST }}
33+
username: ${{ secrets.VPS_USER }}
34+
key: ${{ secrets.DEPLOY_KEY }}
35+
port: 2222
36+
source: "./*"
37+
target: "/var/www/html/evento/tecuruapan/${{ env.DEPLOY_DIR }}"

README.MD

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Estructura del repositorio base para los alumnos
2+
3+
# 📁 index.html (HTML básico para el sitio del alumno)
4+
```html
5+
<!DOCTYPE html>
6+
<html lang="es">
7+
<head>
8+
<meta charset="UTF-8">
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
10+
<title>Mi Sitio Web</title>
11+
</head>
12+
<body>
13+
<h1>Hola, este es mi sitio web desde GitHub Actions 🚀</h1>
14+
<p>Modifica este archivo y haz push para actualizar tu web.</p>
15+
</body>
16+
</html>
17+
```
18+
19+
# 📁 .github/workflows/deploy.yml
20+
```yaml
21+
name: Deploy to VPS
22+
23+
on:
24+
workflow_dispatch: # ← Esto permite lanzarlo manualmente desde la interfaz
25+
push:
26+
branches: [main]
27+
28+
env:
29+
DEPLOY_DIR: ${{ github.actor }} # Usará el nombre de usuario de GitHub automáticamente
30+
31+
jobs:
32+
deploy:
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v3
38+
39+
- name: Crear carpeta remota (si no existe)
40+
uses: appleboy/[email protected]
41+
with:
42+
host: ${{ secrets.VPS_HOST }}
43+
username: ${{ secrets.VPS_USER }}
44+
key: ${{ secrets.DEPLOY_KEY }}
45+
port: 2222
46+
script: |
47+
mkdir -p /var/www/html/evento/tecuruapan/${{ env.DEPLOY_DIR }}
48+
49+
- name: Subir sitio al VPS
50+
uses: appleboy/[email protected]
51+
with:
52+
host: ${{ secrets.VPS_HOST }}
53+
username: ${{ secrets.VPS_USER }}
54+
key: ${{ secrets.DEPLOY_KEY }}
55+
port: 2222
56+
source: "./*"
57+
target: "/var/www/html/evento/tecuruapan/${{ env.DEPLOY_DIR }}"
58+
```
59+
60+
# 📁 README.md
61+
# Sitio Web Automatizado con GitHub Actions 🚀
62+
63+
Este repositorio es una plantilla para subir tu sitio web al servidor de clase automáticamente.
64+
65+
## 🧑‍💻 ¿Qué debes hacer?
66+
67+
1. Haz un **fork** de este repositorio a tu cuenta.
68+
2. Modifica el archivo `.github/workflows/deploy.yml` y cambia la variable `DEPLOY_DIR` con tu nombre o iniciales:
69+
```yaml
70+
env:
71+
DEPLOY_DIR: ${{ github.actor }} # Usará el nombre de usuario de GitHub automáticamente
72+
```
73+
3. Ve a **Settings > Secrets and variables > Actions** en tu fork, y agrega estos **Secrets**:
74+
- `VPS_HOST` → IP del servidor (63.142.255.101)
75+
- `VPS_USER` → `deployuser`
76+
- `DEPLOY_KEY`
77+
78+
```bash
79+
-----BEGIN OPENSSH PRIVATE KEY-----
80+
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
81+
QyNTUxOQAAACDHcPHUxn8ev94vpu1ulnBC0KhpbLU/QvQxNNNGDPndCAAAAJgrYiwzK2Is
82+
MwAAAAtzc2gtZWQyNTUxOQAAACDHcPHUxn8ev94vpu1ulnBC0KhpbLU/QvQxNNNGDPndCA
83+
AAAEDmLoJblrFJ3sB7byk5PgpXvfuXlDIgQf5lXrQxNlgZzMdw8dTGfx6/3i+m7W6WcELQ
84+
qGlstT9C9DE000YM+d0IAAAAFWdpdGh1Yi1hY3Rpb25zLWRlcGxveQ==
85+
-----END OPENSSH PRIVATE KEY-----
86+
```
87+
88+
## 🚀 ¿Cómo lo pruebo?
89+
90+
Haz un push a la rama `main`. GitHub Actions subirá tu sitio automáticamente al servidor.
91+
Puedes verlo en:
92+
```
93+
https://ccavila.dev/tu-nombre/
94+
```
95+
96+
¡Y eso es todo! 🎉

index.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="es">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Mi Sitio Web</title>
7+
</head>
8+
<body>
9+
<h1>Hola, este es mi sitio web desde GitHub Actions 🚀</h1>
10+
<p>Modifica este archivo y haz push para actualizar tu web.</p>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)