Files
Automatic-Parking/.gitea/workflows/docker-build.yml
Szakáts Alpár Zsolt 183d71e203
Some checks failed
Build, Push and Run Container / build (push) Failing after 33s
POC big step
2025-08-12 16:48:16 +02:00

43 lines
1.5 KiB
YAML

name: Build, Push and Run Container
on:
push:
branches:
- main
jobs:
build:
runs-on: ap-host
steps:
- run: which docker && docker --version
- run: which node && node --version || echo "node not found"
- name: Checkout source code
uses: actions/checkout@v4
- name: Build Docker image
run: |
docker build -t docker-registry.automatic-parking.dev/automatic-parking:poc Source/ProofOfConcept
- name: Push to local registry
run: docker push docker-registry.automatic-parking.dev/automatic-parking:poc
- name: Stop existing container (if running)
run: |
if docker ps -a --format '{{.Names}}' | grep -q '^automatic-parking$'; then
docker rm -f automatic-parking
fi
- name: Run new container (Traefik enabled)
run: |
docker run -d \
--name automatic-parking \
--network traefik \
--label "traefik.enable=true" \
--label "traefik.http.routers.automatic-parking.rule=Host(`automatic-parking.dev`)" \
--label "traefik.http.routers.automatic-parking.entrypoints=websecure" \
--label "traefik.http.routers.automatic-parking.tls.certresolver=le" \
--label "traefik.http.services.automatic-parking.loadbalancer.server.port=8080" \
--label "traefik.docker.network=traefik" \
docker-registry.automatic-parking.dev/automatic-parking:poc