From 4feadb93b7ddb51471d8cc8370818bfae1e06c2a Mon Sep 17 00:00:00 2001 From: Vladimir Mikhalev <10498744+heyvaldemar@users.noreply.github.com> Date: Fri, 6 Sep 2024 22:48:39 -0400 Subject: [PATCH] Keycloak with Let's Encrypt Using Docker Compose --- .../workflows/00-deployment-verification.yml | 50 +++++++++++++++++++ README.md | 6 +++ 2 files changed, 56 insertions(+) create mode 100644 .github/workflows/00-deployment-verification.yml diff --git a/.github/workflows/00-deployment-verification.yml b/.github/workflows/00-deployment-verification.yml new file mode 100644 index 0000000..83b8fae --- /dev/null +++ b/.github/workflows/00-deployment-verification.yml @@ -0,0 +1,50 @@ +name: Deployment Verification + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + deploy-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Create necessary Docker networks + run: | + docker network create keycloak-network || true + docker network create traefik-network || true + + - name: Start up services using Docker Compose + run: docker compose -f keycloak-traefik-letsencrypt-docker-compose.yml up -d + + - name: Modify /etc/hosts for internal routing + run: | + echo "127.0.0.1 keycloak.heyvaldemar.net" | sudo tee -a /etc/hosts + echo "127.0.0.1 traefik.keycloak.heyvaldemar.net" | sudo tee -a /etc/hosts + + - name: Print Docker Compose services status + run: docker ps + + - name: Wait for the application to be ready via Traefik + run: | + echo "Checking the routing and availability of application via Traefik..." + timeout 5m bash -c 'while ! curl -fsSLk "https://keycloak.heyvaldemar.net"; do echo "Waiting for the application to be ready..."; sleep 10; done' + + - name: Inspect Network Configuration + run: | + docker network inspect keycloak-network + docker network inspect traefik-network + + - name: Shutdown Docker Compose services + if: always() + run: docker compose -f keycloak-traefik-letsencrypt-docker-compose.yml down diff --git a/README.md b/README.md index bd98220..cbf60fa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # Keycloak with Let's Encrypt Using Docker Compose +[![Deployment Verification](https://github.com/heyvaldemar/keycloak-traefik-letsencrypt-docker-compose/actions/workflows/00-deployment-verification.yml/badge.svg)](https://github.com/heyvaldemar/keycloak-traefik-letsencrypt-docker-compose/actions) + +The badge displayed on my repository indicates the status of the deployment verification workflow as executed on the latest commit to the main branch. + +**Passing**: This means the most recent commit has successfully passed all deployment checks, confirming that the Docker Compose setup functions correctly as designed. + 📙 The complete installation guide is available on my [website](https://www.heyvaldemar.com/install-keycloak-using-docker-compose/). ❗ Change variables in the `.env` to meet your requirements.