1 Commits

Author SHA1 Message Date
4d80c71f92 Added version number
All checks were successful
Build and Push Image / build-and-push (push) Successful in 7m31s
2025-07-05 21:09:01 -04:00
3 changed files with 8 additions and 3 deletions

View File

@@ -34,3 +34,4 @@ jobs:
context: . context: .
push: true push: true
tags: git.kaisei.app/amatsugu/aoba:${{ env.VERSION }} tags: git.kaisei.app/amatsugu/aoba:${{ env.VERSION }}
build-args: VERSION=${ env.VERSION }

View File

@@ -1,3 +1,5 @@
use std::env;
use dioxus::prelude::*; use dioxus::prelude::*;
use crate::{Route, contexts::AuthContext}; use crate::{Route, contexts::AuthContext};
@@ -47,9 +49,10 @@ pub fn Widgets() -> Element {
#[component] #[component]
pub fn Utils() -> Element { pub fn Utils() -> Element {
let mut auth_context = use_context::<AuthContext>(); let mut auth_context = use_context::<AuthContext>();
let version = env::var("APP_VERSION").unwrap_or("DEBUG".into());
rsx! { rsx! {
div { class: "utils", div { class: "utils",
div { "{version}" }
div { onclick: move |_| auth_context.logout(), "Logout" } div { onclick: move |_| auth_context.logout(), "Logout" }
} }
} }

View File

@@ -24,7 +24,8 @@ RUN apt install -y protobuf-compiler libprotobuf-dev ffmpeg
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
RUN cargo binstall dioxus-cli --root /.cargo -y --force RUN cargo binstall dioxus-cli --root /.cargo -y --force
ENV PATH="/.cargo/bin:$PATH" ENV PATH="/.cargo/bin:$PATH"
ARG VERSION
ENV APP_VERSION=$VERSION
# Create the final bundle folder. Bundle always executes in release mode with optimizations enabled # Create the final bundle folder. Bundle always executes in release mode with optimizations enabled
RUN dx bundle --platform web RUN dx bundle --platform web
@@ -56,7 +57,7 @@ RUN dotnet publish "./AobaServer.csproj" -c $BUILD_CONFIGURATION -o /app/publish
# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) # This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
FROM base AS final FROM base AS final
WORKDIR /app WORKDIR /app
COPY --from=publish /app/publish . COPY --from=publish /app/publish .
COPY --from=client-builder /bin/ffmpeg /bin/ffprobe /bin/ffplay /usr/bin/ COPY --from=client-builder /bin/ffmpeg /bin/ffprobe /bin/ffplay /usr/bin/
ENTRYPOINT ["dotnet", "AobaServer.dll"] ENTRYPOINT ["dotnet", "AobaServer.dll"]