Compare commits
9 Commits
20e1df177c
...
cicd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68d7cbd32e | ||
|
|
0ff5419c23 | ||
|
|
b7a47ca903 | ||
|
|
b3eb962024 | ||
| d9f904231a | |||
|
|
c2ab088799 | ||
|
|
f336daf54b | ||
|
|
991cb57c88 | ||
|
|
1fbc2b7521 |
@@ -12,7 +12,17 @@ jobs:
|
||||
name: Build
|
||||
runs-on: [ubuntu-latest, aya01]
|
||||
steps:
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- uses: docker/build-push-action@v5
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
tags: tudattr/athome:latest
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: user/app:latest
|
||||
|
||||
625
Cargo.lock
generated
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "athome"
|
||||
version = "0.2.0"
|
||||
version = "0.2.2"
|
||||
authors = ["Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>"]
|
||||
edition = "2021"
|
||||
|
||||
@@ -8,7 +8,6 @@ edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.197", features = ["derive"] }
|
||||
|
||||
dioxus = { version = "0.5", features = ["fullstack", "router"] }
|
||||
|
||||
# Debug
|
||||
|
||||
11
Dockerfile
@@ -1,9 +1,9 @@
|
||||
FROM rust:1.77.2 as dioxus
|
||||
FROM rust:1.80.1 AS dioxus
|
||||
RUN cargo install dioxus-cli@^0.5
|
||||
|
||||
FROM dioxus as builder
|
||||
FROM dioxus AS builder
|
||||
WORKDIR /athome/
|
||||
RUN apt-get update && apt-get install nodejs npm -y && rm -rf /var/lib/apt/lists/*
|
||||
RUN apt-get update && apt-get install nodejs npm libssl-dev musl-tools -y && rm -rf /var/lib/apt/lists/*
|
||||
RUN npm install -D tailwindcss
|
||||
COPY ./src/ ./src/
|
||||
COPY ./assets/ ./assets/
|
||||
@@ -11,9 +11,10 @@ COPY ./Cargo.toml ./Cargo.toml
|
||||
COPY ./input.css ./input.css
|
||||
COPY ./Dioxus.toml ./Dioxus.toml
|
||||
COPY ./tailwind.config.js ./tailwind.config.js
|
||||
RUN npx tailwindcss -i ./input.css -o ./assets/tailwind.css && dx build --platform fullstack --release
|
||||
RUN npx tailwindcss -i ./input.css -o ./assets/tailwind.css
|
||||
RUN dx build --platform fullstack --release
|
||||
|
||||
FROM dioxus as runner
|
||||
FROM dioxus AS runner
|
||||
WORKDIR /app/
|
||||
COPY --from=builder /athome/docs/ ./docs/
|
||||
CMD [ "./docs/athome" ]
|
||||
|
||||
BIN
assets/android-chrome-192x192.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
assets/android-chrome-512x512.png
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
assets/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
assets/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 742 B |
BIN
assets/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 11 MiB |
|
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 190 KiB |
|
Before Width: | Height: | Size: 75 KiB |
41
assets/robots.txt
Normal file
@@ -0,0 +1,41 @@
|
||||
User-agent: CCBot
|
||||
Disallow: /
|
||||
|
||||
User-agent: img2dataset
|
||||
Disallow: /
|
||||
|
||||
User-agent: Google-Extended
|
||||
Disallow: /
|
||||
|
||||
User-agent: anthropic-ai
|
||||
Disallow: /
|
||||
|
||||
User-agent: Claude-Web
|
||||
Disallow: /
|
||||
|
||||
User-agent: Omgilibot
|
||||
Disallow: /
|
||||
|
||||
User-agent: Omgili
|
||||
Disallow: /
|
||||
|
||||
User-agent: FacebookBot
|
||||
Disallow: /
|
||||
|
||||
User-agent: Bytespider
|
||||
Disallow: /
|
||||
|
||||
User-agent: magpie-crawler
|
||||
Disallow: /
|
||||
|
||||
User-Agent: GPTBot
|
||||
Disallow: /
|
||||
|
||||
User-agent: *
|
||||
Disallow: /impressum
|
||||
Allow: /
|
||||
Allow: /resume
|
||||
Allow: /publications
|
||||
Allow: /consulting
|
||||
Sitemap: https://www.tudattr.dev/sitemap.xml
|
||||
|
||||
1
assets/site.webmanifest
Normal file
@@ -0,0 +1 @@
|
||||
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
|
||||
27
assets/sitemap.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://www.tudattr.dev/</loc>
|
||||
<lastmod>2024-07-25</lastmod>
|
||||
<changefreq>monthly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.tudattr.dev/resume</loc>
|
||||
<lastmod>2024-07-25</lastmod>
|
||||
<changefreq>monthly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.tudattr.dev/publications</loc>
|
||||
<lastmod>2024-07-25</lastmod>
|
||||
<changefreq>monthly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.tudattr.dev/consulting</loc>
|
||||
<lastmod>2024-07-25</lastmod>
|
||||
<changefreq>monthly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
</urlset>
|
||||
@@ -676,10 +676,6 @@ video {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.inline-flex {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.size-auto {
|
||||
width: auto;
|
||||
height: auto;
|
||||
@@ -729,11 +725,6 @@ video {
|
||||
width: 0.75rem;
|
||||
}
|
||||
|
||||
.w-fit {
|
||||
width: -moz-fit-content;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.w-full {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -751,6 +742,10 @@ video {
|
||||
max-width: 2rem;
|
||||
}
|
||||
|
||||
.max-w-md {
|
||||
max-width: 28rem;
|
||||
}
|
||||
|
||||
.max-w-sm {
|
||||
max-width: 24rem;
|
||||
}
|
||||
@@ -759,10 +754,6 @@ video {
|
||||
max-width: 36rem;
|
||||
}
|
||||
|
||||
.max-w-md {
|
||||
max-width: 28rem;
|
||||
}
|
||||
|
||||
.flex-grow {
|
||||
flex-grow: 1;
|
||||
}
|
||||
@@ -783,10 +774,6 @@ video {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.justify-start {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.justify-end {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
@@ -815,10 +802,6 @@ video {
|
||||
margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));
|
||||
}
|
||||
|
||||
.overflow-hidden {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.overflow-x-auto {
|
||||
overflow-x: auto;
|
||||
}
|
||||
@@ -973,10 +956,6 @@ video {
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.p-1 {
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
||||
.p-3 {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
@@ -1303,10 +1282,6 @@ video {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.sm\:max-w-sm {
|
||||
max-width: 24rem;
|
||||
}
|
||||
|
||||
.sm\:flex-row {
|
||||
flex-direction: row;
|
||||
}
|
||||
@@ -1323,10 +1298,6 @@ video {
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.md\:max-w-md {
|
||||
max-width: 28rem;
|
||||
}
|
||||
|
||||
.md\:bg-transparent {
|
||||
background-color: transparent;
|
||||
}
|
||||
@@ -1353,12 +1324,6 @@ video {
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
.xl\:max-w-screen-xl {
|
||||
max-width: 1280px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.dark\:border-gray-600 {
|
||||
--tw-border-opacity: 1;
|
||||
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 46 KiB |
@@ -1,9 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
VERSION=0.1.2
|
||||
TAG=$(git branch | grep "*" | awk '{ print $2 }')
|
||||
LOCAL_IMAGE="athome"
|
||||
REGISTRY="mos4"
|
||||
REMOTE_IMAGE="athome"
|
||||
DOCKERFILE="./Dockerfile"
|
||||
|
||||
docker build -t $LOCAL_IMAGE .
|
||||
docker tag $LOCAL_IMAGE:latest mos4/$REMOTE_IMAGE:$VERSION
|
||||
docker push mos4/$REMOTE_IMAGE:$VERSION
|
||||
echo "DOCKERFILE: $DOCKERFILE"
|
||||
echo "TAG: $TAG"
|
||||
echo "LOCAL_IMAGE: $LOCAL_IMAGE"
|
||||
echo "REGISTRY: $REGISTRY"
|
||||
echo "REMOTE_IMAGE: $REMOTE_IMAGE"
|
||||
|
||||
#docker buildx build --platform linux/amd64,linux/arm64 -f ${DOCKERFILE} -t \
|
||||
# ${REGISTRY}/${REMOTE_IMAGE}:${TAG} . --push
|
||||
|
||||
docker buildx build --platform linux/amd64 -f ${DOCKERFILE} \
|
||||
-t ${REGISTRY}/${REMOTE_IMAGE}:${TAG} \
|
||||
-t ${REGISTRY}/${REMOTE_IMAGE}:latest . --push
|
||||
|
||||
@@ -21,6 +21,19 @@ pub fn P(props: PProps) -> Element {
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn Title(props: PProps) -> Element {
|
||||
rsx! {
|
||||
div {
|
||||
class: "{props.class}",
|
||||
h1 {
|
||||
class: "mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white",
|
||||
{props.children}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn H1(props: PProps) -> Element {
|
||||
rsx! {
|
||||
@@ -84,7 +97,7 @@ pub fn Card(prop: CardProp) -> Element {
|
||||
Picture {src: "{prop.picture}"},
|
||||
}
|
||||
}
|
||||
H5 { "{prop.name}", span { class: "text-grey-600 dark:text-grey-500 text-lg", " {prop.gender}" } },
|
||||
Title { "{prop.name}", span { class: "text-grey-600 dark:text-grey-500 text-lg", " {prop.gender}" } },
|
||||
{ prop.children }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
mod footer;
|
||||
mod header;
|
||||
pub mod footer;
|
||||
pub mod header;
|
||||
|
||||
use crate::{Body, Route};
|
||||
use footer::Footer;
|
||||
@@ -10,12 +10,12 @@ use header::Header;
|
||||
pub fn Layout() -> Element {
|
||||
rsx! {
|
||||
div {
|
||||
class: "flex flex-col min-h-screen" ,
|
||||
class: "flex flex-col min-h-screen",
|
||||
Header {},
|
||||
Body {
|
||||
Outlet::<Route> {},
|
||||
}
|
||||
Footer {},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
52
src/main.rs
@@ -2,9 +2,12 @@
|
||||
|
||||
use std::str::FromStr;
|
||||
|
||||
use components::H1;
|
||||
use dioxus::prelude::*;
|
||||
use dioxus_sdk::i18n::*;
|
||||
|
||||
use layout::footer::Footer;
|
||||
use layout::header::Header;
|
||||
use tracing::Level;
|
||||
|
||||
pub mod components;
|
||||
@@ -61,9 +64,40 @@ fn App() -> Element {
|
||||
|
||||
rsx! {
|
||||
meta {
|
||||
name: "robots",
|
||||
content: "noindex",
|
||||
name: "description",
|
||||
content: "Visit Tuan-Dat Tran's website for his CV, publications, projects, and consulting services. Connect for collaboration.",
|
||||
},
|
||||
script {
|
||||
r#type: "application/ld+json",
|
||||
"
|
||||
{{
|
||||
\"@context\": \"https://schema.org\",
|
||||
\"@type\": \"ProfilePage\",
|
||||
\"mainEntity\": {{
|
||||
\"@type\": \"Person\",
|
||||
\"name\": \"Tuan-Dat Tran\",
|
||||
\"alternateName\": \"TuDatTr\",
|
||||
\"image\": \"https://www.tudattr.dev/pictures/headshot.webp\",
|
||||
}}
|
||||
}}
|
||||
"
|
||||
}
|
||||
// meta {
|
||||
// property: "og:title",
|
||||
// content: "Tuan-Dat Trans Personal Website",
|
||||
// }
|
||||
// meta {
|
||||
// property: "og:description",
|
||||
// content: "Explore Tuan-Dat Tran's personal website featuring his CV, publications, projects, and consulting services. Get insights into his professional journey and connect for collaboration opportunities.",
|
||||
// }
|
||||
// meta {
|
||||
// property: "og:image",
|
||||
// content: "https://www.tudattr.dev/pictures/headshot.webp",
|
||||
// }
|
||||
// meta {
|
||||
// property: "og:url",
|
||||
// content: "https://tudattr.dev",
|
||||
// }
|
||||
div {
|
||||
class: "bg-white dark:bg-gray-900 min-h-screen",
|
||||
Router::<Route> {},
|
||||
@@ -75,12 +109,16 @@ fn App() -> Element {
|
||||
fn PageNotFound(route: Vec<String>) -> Element {
|
||||
rsx! {
|
||||
div {
|
||||
class: "h-screen items-center justify-center",
|
||||
img {
|
||||
class: "size-auto",
|
||||
src: "https://raw.githubusercontent.com/SAWARATSUKI/ServiceLogos/main/404Notfound/NotFound.png"
|
||||
class: "flex flex-col min-h-screen items",
|
||||
Header {},
|
||||
div {
|
||||
class: "container mx-auto p-4 flex items-center justify-center max-w-md w-full",
|
||||
H1 {
|
||||
"Site not found (404)"
|
||||
},
|
||||
}
|
||||
}
|
||||
Footer {}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||