Add static homepage, Dockerfile (nginx), and CI build/push workflow
- index.html: clean static homepage (name + intro, links), light/dark mode - Dockerfile: nginx:1.27-alpine serves the page on :80 with a healthcheck - .gitea/workflows/build.yml: on push to main, build and push the image to git.ffaerber.duckdns.org/ffaerber/homepage (tags :latest and :sha)
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
name: build-and-push
|
||||||
|
run-name: "build-and-push · ${gitea.ref_name}"
|
||||||
|
# Builds the homepage image and pushes it to this Gitea instance's container
|
||||||
|
# registry as git.ffaerber.duckdns.org/ffaerber/homepage:latest on every push to main.
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE: git.ffaerber.duckdns.org/ffaerber/homepage
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to container registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.ffaerber.duckdns.org
|
||||||
|
username: ${{ gitea.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ env.IMAGE }}:latest
|
||||||
|
${{ env.IMAGE }}:${{ gitea.sha }}
|
||||||
|
provenance: false
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
FROM nginx:1.27-alpine
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.title="ffaerber/homepage" \
|
||||||
|
org.opencontainers.image.source="https://git.ffaerber.duckdns.org/ffaerber/homepage"
|
||||||
|
|
||||||
|
COPY index.html /usr/share/nginx/html/index.html
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||||
|
CMD wget -qO- http://127.0.0.1/ >/dev/null 2>&1 || exit 1
|
||||||
+99
@@ -0,0 +1,99 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>ffaerber</title>
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--fg: #1f2328;
|
||||||
|
--muted: #57606a;
|
||||||
|
--bg: #ffffff;
|
||||||
|
--accent: #0969da;
|
||||||
|
--border: #d0d7de;
|
||||||
|
}
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
:root {
|
||||||
|
--fg: #e6edf3;
|
||||||
|
--muted: #9198a1;
|
||||||
|
--bg: #0d1117;
|
||||||
|
--accent: #58a6ff;
|
||||||
|
--border: #30363d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
* { box-sizing: border-box; }
|
||||||
|
html, body { margin: 0; padding: 0; }
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||||
|
color: var(--fg);
|
||||||
|
background: var(--bg);
|
||||||
|
display: flex;
|
||||||
|
min-height: 100vh;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 2rem;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
main {
|
||||||
|
max-width: 38rem;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: clamp(2rem, 5vw, 3rem);
|
||||||
|
margin: 0 0 0.5rem;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
.tagline {
|
||||||
|
color: var(--accent);
|
||||||
|
font-weight: 600;
|
||||||
|
margin: 0 0 1.5rem;
|
||||||
|
}
|
||||||
|
p { color: var(--muted); margin: 0 0 1rem; }
|
||||||
|
.links {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 0.75rem;
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
}
|
||||||
|
.links a {
|
||||||
|
color: var(--fg);
|
||||||
|
text-decoration: none;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
transition: border-color 0.15s, color 0.15s;
|
||||||
|
}
|
||||||
|
.links a:hover { border-color: var(--accent); color: var(--accent); }
|
||||||
|
footer {
|
||||||
|
margin-top: 3rem;
|
||||||
|
padding-top: 1.5rem;
|
||||||
|
border-top: 1px solid var(--border);
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<h1>ffaerber</h1>
|
||||||
|
<p class="tagline">Homelab & self-hosting enthusiast</p>
|
||||||
|
<p>
|
||||||
|
Hi, I'm ffaerber. This is my corner of the internet — a self-hosted homepage
|
||||||
|
running on my homelab. I tinker with containers, Gitea, and anything that runs
|
||||||
|
on a quiet box in the corner.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
More coming soon. In the meantime, you can find my code over on Gitea.
|
||||||
|
</p>
|
||||||
|
<nav class="links">
|
||||||
|
<a href="https://git.ffaerber.duckdns.org/ffaerber">Gitea</a>
|
||||||
|
<a href="https://homepage.ffaerber.duckdns.org">Homepage</a>
|
||||||
|
</nav>
|
||||||
|
<footer>
|
||||||
|
Served from a container built in
|
||||||
|
<a href="https://git.ffaerber.duckdns.org/ffaerber/homepage">ffaerber/homepage</a>.
|
||||||
|
</footer>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user