Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

Estructura del repositorio base para los alumnos

📁 index.html (HTML básico para el sitio del alumno)

<!DOCTYPE html><htmllang="es"><head><metacharset="UTF-8"><metaname="viewport" content="width=device-width, initial-scale=1.0"><title>Mi Sitio Web</title></head><body><h1>Hola, este es mi sitio web desde GitHub Actions 🚀</h1><p>Modifica este archivo y haz push para actualizar tu web.</p></body></html>

📁 .github/workflows/deploy.yml

name: Deploy to VPSon:
workflow_dispatch: # ← Esto permite lanzarlo manualmente desde la interfazpush:
branches: [main]env:
DEPLOY_DIR: ${{ github.actor }} # Usará el nombre de usuario de GitHub automáticamentejobs:
deploy:
runs-on: ubuntu-lateststeps:
- name: Checkout codeuses: actions/checkout@v3
- name: Crear carpeta remota (si no existe)uses: appleboy/ssh-action@v0.1.8with:
host: ${{ secrets.VPS_HOST }}username: ${{ secrets.VPS_USER }}key: ${{ secrets.DEPLOY_KEY }}port: 2222script: | mkdir -p /var/www/html/evento/tecuruapan/${{ env.DEPLOY_DIR }} - name: Subir sitio al VPSuses: appleboy/scp-action@v0.1.3with:
host: ${{ secrets.VPS_HOST }}username: ${{ secrets.VPS_USER }}key: ${{ secrets.DEPLOY_KEY }}port: 2222source: "./*"target: "/var/www/html/evento/tecuruapan/${{ env.DEPLOY_DIR }}"

📁 README.md

Sitio Web Automatizado con GitHub Actions 🚀

Este repositorio es una plantilla para subir tu sitio web al servidor de clase automáticamente.

🧑‍💻 ¿Qué debes hacer?

  1. Haz un fork de este repositorio a tu cuenta.
  2. Modifica el archivo .github/workflows/deploy.yml y cambia la variable DEPLOY_DIR con tu nombre o iniciales:
    env:
    DEPLOY_DIR: ${{ github.actor }} # Usará el nombre de usuario de GitHub automáticamente
  3. Ve a Settings > Secrets and variables > Actions en tu fork, y agrega estos Secrets:
    • VPS_HOST → IP del servidor (63.142.255.101)
    • VPS_USERdeployuser
    • DEPLOY_KEY
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACDHcPHUxn8ev94vpu1ulnBC0KhpbLU/QvQxNNNGDPndCAAAAJgrYiwzK2Is
MwAAAAtzc2gtZWQyNTUxOQAAACDHcPHUxn8ev94vpu1ulnBC0KhpbLU/QvQxNNNGDPndCA
AAAEDmLoJblrFJ3sB7byk5PgpXvfuXlDIgQf5lXrQxNlgZzMdw8dTGfx6/3i+m7W6WcELQ
qGlstT9C9DE000YM+d0IAAAAFWdpdGh1Yi1hY3Rpb25zLWRlcGxveQ==
-----END OPENSSH PRIVATE KEY-----

🚀 ¿Cómo lo pruebo?

Haz un push a la rama main. GitHub Actions subirá tu sitio automáticamente al servidor. Puedes verlo en:

https://ccavila.dev/evento/tecuruapan/tu-nombre/

¡Y eso es todo! 🎉

About

Repositorio para Taller

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages