feat: add workflow for ghcr publish
This commit is contained in:
68
.github/workflows/docker-publish.yml
vendored
Normal file
68
.github/workflows/docker-publish.yml
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
name: Build and Publish Docker Image
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Docker image tag (optional, defaults to "manual")'
|
||||
required: false
|
||||
default: 'manual'
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=raw,value=${{ github.event.inputs.tag }},enable=${{ github.event_name == 'workflow_dispatch' }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Generate artifact attestation
|
||||
uses: actions/attest-build-provenance@v1
|
||||
with:
|
||||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
|
||||
subject-digest: ${{ steps.build.outputs.digest }}
|
||||
push-to-registry: true
|
79
README.md
79
README.md
@@ -4,8 +4,6 @@ Este proyecto automatiza el envio de denuncias de emisiones ilegales de contenid
|
||||
|
||||
## 🚨 AVISO CRÍTICO - LEER ANTES DE USAR 🚨
|
||||
|
||||
### ⚠️ NUNCA USAR DATOS MOCK EN PRODUCCIÓN ⚠️
|
||||
|
||||
**🛑 IMPORTANTE: Este proyecto NUNCA debe ejecutarse con `USE_MOCK_DATA=true` contra el sitio web real de LaLiga (https://laligabares.com/denuncias/). Los datos mock estan disenados UNICAMENTE para pruebas en entornos de desarrollo.**
|
||||
|
||||
**🛑 NO USES VPN: Si vas a hacer denuncias reales, NO uses VPN. LaLiga necesita saber que eres un denunciante serio y local.**
|
||||
@@ -14,7 +12,7 @@ Este proyecto automatiza el envio de denuncias de emisiones ilegales de contenid
|
||||
|
||||
```bash
|
||||
# ⚠️ NUNCA EJECUTAR ESTE COMANDO CONTRA EL SITIO REAL DE LALIGA ⚠️
|
||||
docker run -e USE_MOCK_DATA=true laliga-denuncias
|
||||
docker run -e USE_MOCK_DATA=true ghcr.io/jorgeteixe/l4l1g4-d3nunc145:latest
|
||||
# ⚠️ ESTE COMANDO ENVIARÁ DATOS FALSOS AL SITIO OFICIAL ⚠️
|
||||
```
|
||||
|
||||
@@ -93,10 +91,14 @@ USE_MOCK_DATA=false
|
||||
### Opcion 1: Usando Docker (Recomendado)
|
||||
|
||||
```bash
|
||||
# Construir la imagen
|
||||
docker build -t laliga-denuncias .
|
||||
# Usar imagen precompilada desde GitHub Container Registry
|
||||
docker run -v $(pwd)/denuncias.yml:/app/denuncias.yml \
|
||||
-v $(pwd)/images:/app/images \
|
||||
-v $(pwd)/.env:/app/.env \
|
||||
ghcr.io/jorgeteixe/l4l1g4-d3nunc145:latest
|
||||
|
||||
# Ejecutar con archivos locales
|
||||
# O construir localmente si prefieres
|
||||
docker build -t laliga-denuncias .
|
||||
docker run -v $(pwd)/denuncias.yml:/app/denuncias.yml \
|
||||
-v $(pwd)/images:/app/images \
|
||||
-v $(pwd)/.env:/app/.env \
|
||||
@@ -145,16 +147,19 @@ imagen: "" # No subir imagen
|
||||
|
||||
### Modo Produccion (Denuncias Reales)
|
||||
```bash
|
||||
# Configuracion en .env
|
||||
USE_MOCK_DATA=false
|
||||
HEADLESS=false # Para ver el proceso
|
||||
# Ejecutar con denuncias reales del archivo denuncias.yml
|
||||
docker run -v $(pwd)/denuncias.yml:/app/denuncias.yml \
|
||||
-v $(pwd)/images:/app/images \
|
||||
-e HEADLESS=false \
|
||||
ghcr.io/jorgeteixe/l4l1g4-d3nunc145:latest
|
||||
```
|
||||
|
||||
### Modo Prueba (SOLO PARA DESARROLLO)
|
||||
```bash
|
||||
# ⚠️ NUNCA usar en produccion
|
||||
USE_MOCK_DATA=true
|
||||
TARGET_URL=http://localhost:3000 # URL de prueba
|
||||
# ⚠️ NUNCA usar en produccion contra LaLiga real
|
||||
docker run -e USE_MOCK_DATA=true \
|
||||
-e TARGET_URL=http://localhost:3000 \
|
||||
ghcr.io/jorgeteixe/l4l1g4-d3nunc145:latest
|
||||
```
|
||||
|
||||
## 🔍 Que Hace el Script
|
||||
@@ -167,20 +172,6 @@ TARGET_URL=http://localhost:3000 # URL de prueba
|
||||
6. **Vuelve al formulario** para la siguiente denuncia (si hay mas)
|
||||
7. **Registra todo el proceso** en logs detallados
|
||||
|
||||
## 📊 Logs y Seguimiento
|
||||
|
||||
El script proporciona logs detallados:
|
||||
```
|
||||
2023-09-11 14:23:45 - INFO - Opening browser to: https://laligabares.com/denuncias/
|
||||
2023-09-11 14:23:46 - INFO - Cookie consent dialog closed
|
||||
2023-09-11 14:23:48 - INFO - Popup modal closed
|
||||
2023-09-11 14:23:49 - INFO - --- Processing submission 1/3 ---
|
||||
2023-09-11 14:23:49 - INFO - Submitting for: Bar Deportivo Centro
|
||||
2023-09-11 14:23:50 - INFO - Filling form with data...
|
||||
2023-09-11 14:23:51 - INFO - Using specified image: /app/images/evidencia1.jpg
|
||||
2023-09-11 14:23:52 - INFO - Form submitted successfully
|
||||
```
|
||||
|
||||
## 🔒 Consideraciones Legales y Eticas
|
||||
|
||||
- **Solo denuncias veraces**: Usa este sistema unicamente para denuncias reales y verificadas
|
||||
@@ -188,40 +179,6 @@ El script proporciona logs detallados:
|
||||
- **Responsabilidad**: Eres responsable de la veracidad de las denuncias enviadas
|
||||
- **Uso apropiado**: No abuses del sistema de denuncias
|
||||
|
||||
## 🛠️ Solucion de Problemas
|
||||
|
||||
### El navegador no se abre
|
||||
```bash
|
||||
# Verificar que Docker tiene permisos de display
|
||||
xhost +local:docker # En Linux
|
||||
|
||||
# O usar modo headless
|
||||
echo "HEADLESS=true" >> .env
|
||||
```
|
||||
|
||||
### Imagenes no se suben
|
||||
```bash
|
||||
# Verificar formato y tamano
|
||||
ls -la images/
|
||||
file images/* # Verificar formato
|
||||
du -h images/* # Verificar tamano (max 5MB)
|
||||
```
|
||||
|
||||
### Formulario no se envia
|
||||
- Verificar que todos los campos obligatorios estan completos
|
||||
- Comprobar la conexion a internet
|
||||
- Revisar los logs para errores especificos
|
||||
|
||||
## 📞 Soporte
|
||||
|
||||
Si encuentras problemas tecnicos:
|
||||
1. Revisa los logs detallados
|
||||
2. Verifica tu configuracion en `denuncias.yml`
|
||||
3. Comprueba que las imagenes son validas
|
||||
4. Asegurate de usar `USE_MOCK_DATA=false` para denuncias reales
|
||||
|
||||
---
|
||||
|
||||
## 🤝 Contribuir
|
||||
|
||||
¡Las contribuciones son bienvenidas! Si quieres ayudar a mejorar este proyecto, consulta nuestra [Guía de Contribución](CONTRIBUTING.md).
|
||||
@@ -239,4 +196,4 @@ Este proyecto está licenciado bajo la Licencia AGPL-3.0-or-later. Consulta el a
|
||||
|
||||
## ⚠️ Recordatorio Final
|
||||
|
||||
**Este sistema debe usarse responsablemente y solo para denuncias legitimas de emisiones ilegales. LaLiga utiliza estos reportes para proteger los derechos de transmision deportiva.**
|
||||
**Este sistema debe usarse responsablemente y solo para denuncias legitimas de emisiones ilegales. LaLiga utiliza estos reportes para proteger los derechos de transmision deportiva.**
|
||||
|
Reference in New Issue
Block a user