diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08c0c06..6621e46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build latest image +name: Build current image on: push: branches: @@ -8,7 +8,7 @@ on: - 'LICENSE' jobs: - publish: + build: runs-on: self-hosted steps: - name: Docker meta @@ -18,7 +18,7 @@ jobs: images: | ghcr.io/defguard/defguard-proxy tags: | - type=raw,value=latest + type=raw,value=current type=ref,event=branch type=sha - name: Login to GitHub container registry diff --git a/src/server.rs b/src/server.rs index b06f506..393b496 100644 --- a/src/server.rs +++ b/src/server.rs @@ -50,6 +50,10 @@ async fn app_info() -> ApiResult> { Ok(Json(AppInfo { version })) } +async fn healthcheck() -> &'static str { + "I'm alive!" +} + pub async fn run_server(config: Config) -> anyhow::Result<()> { info!("Starting Defguard proxy server"); @@ -78,6 +82,7 @@ pub async fn run_server(config: Config) -> anyhow::Result<()> { "/api/v1", Router::new() .nest("/enrollment", enrollment::router()) + .route("/health", get(healthcheck)) .route("/info", get(app_info)), ) .nest_service("/svg", serve_images)