47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
name: Verificar despliegue Docker
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: docker-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Obtener repositorio
|
|
uses: actions/checkout@v4
|
|
- name: Configurar Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Compilar imagen para Coolify
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: false
|
|
load: true
|
|
tags: infinitus-web:ci
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
- name: Verificar servidor y rutas de React
|
|
run: |
|
|
docker run -d --name infinitus-web -p 8080:8080 infinitus-web:ci
|
|
trap 'docker logs infinitus-web; docker rm -f infinitus-web' EXIT
|
|
for intento in $(seq 1 30); do
|
|
if curl --fail --silent http://localhost:8080/healthz; then break; fi
|
|
sleep 1
|
|
done
|
|
curl --fail --silent http://localhost:8080/healthz
|
|
for ruta in / /contact /blog/2 /services/tsia2; do
|
|
curl --fail --silent "http://localhost:8080$ruta" | grep -q 'id="root"'
|
|
done
|
|
test "$(curl --silent --output /dev/null --write-out '%{http_code}' http://localhost:8080/assets/inexistente.js)" = 404
|