All checks were successful
Build, Push and Run Container / build (push) Successful in 23s
Removes a redundant host config in the docker file. Adds HttpContextAccessor to the service collection. This component is used to provide access to the current request context.
54 lines
1.8 KiB
YAML
54 lines
1.8 KiB
YAML
name: Build, Push and Run Container
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ap-host
|
|
|
|
steps:
|
|
- name: Sanity check -- docker & node
|
|
run: |
|
|
which docker && docker --version
|
|
which node && node --version || echo "node not found"
|
|
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Docker login (private registry)
|
|
run: |
|
|
docker login docker-registry.automatic-parking.dev \
|
|
--username server --password IXJHwwQK4ufKkhV
|
|
|
|
- name: Build Docker image (context = Source/ProofOfConcept)
|
|
run: |
|
|
docker build \
|
|
-f Source/ProofOfConcept/Dockerfile \
|
|
-t docker-registry.automatic-parking.dev/automatic-parking:poc \
|
|
Source
|
|
|
|
- name: Push to 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.app`)' \
|
|
--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' \
|
|
-e ASPNETCORE_ENVIRONMENT=Development \
|
|
docker-registry.automatic-parking.dev/automatic-parking:poc
|
|
|