diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..40a90e9 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,47 @@ +name: Docker + +on: + push: + tags: + - "v*" + +jobs: + docker: + name: Build and push Docker image + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker registry + uses: docker/login-action@v3 + with: + registry: ${{ vars.DOCKER_REGISTRY }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ vars.DOCKER_REGISTRY }}/${{ vars.DOCKER_IMAGE }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/src/routes/emotes.rs b/src/routes/emotes.rs index 736e233..2e87e30 100644 --- a/src/routes/emotes.rs +++ b/src/routes/emotes.rs @@ -1,7 +1,7 @@ use axum::{ extract::{Multipart, Path, State}, http::StatusCode, - response::{IntoResponse, Json}, + response::{Html, IntoResponse, Json}, }; use serde_json::json; @@ -11,9 +11,9 @@ use crate::{ }; /// GET / -/// Returns a simple health-check message. +/// Serves an HTML page that dynamically loads and displays emotes from /json. pub async fn root() -> impl IntoResponse { - Json(json!({"status": "ok", "message": "mikebase server is running"})) + Html(include_str!("../templates/index.html")) } /// GET /json diff --git a/src/templates/index.html b/src/templates/index.html new file mode 100644 index 0000000..e18bfe3 --- /dev/null +++ b/src/templates/index.html @@ -0,0 +1,142 @@ + + + + + +MIKEBASE + + + + +
+
Copied!
+ + +