From bc816c0925e226ffb71c3939e9929328431ba4c5 Mon Sep 17 00:00:00 2001 From: nick Date: Sun, 12 Jul 2026 05:53:08 +0800 Subject: [PATCH] Initial commit: static landing page with CI/CD --- .gitea/workflows/build.yml | 21 ++++++++++++++ Dockerfile | 2 ++ index.html | 28 +++++++++++++++++++ manifests/deployment.yaml | 57 ++++++++++++++++++++++++++++++++++++++ manifests/namespace.yaml | 4 +++ 5 files changed, 112 insertions(+) create mode 100644 .gitea/workflows/build.yml create mode 100644 Dockerfile create mode 100644 index.html create mode 100644 manifests/deployment.yaml create mode 100644 manifests/namespace.yaml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..0e2f0f9 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,21 @@ +name: build +on: + push: + branches: [main] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Log in to Gitea container registry + run: echo "${{ secrets.CI_REGISTRY_TOKEN }}" | docker login gitea.niq-dev.com -u "${{ gitea.actor }}" --password-stdin + + - name: Build image + run: docker build -t gitea.niq-dev.com/gitea_admin/landing:${{ gitea.sha }} -t gitea.niq-dev.com/gitea_admin/landing:latest . + + - name: Push image + run: | + docker push gitea.niq-dev.com/gitea_admin/landing:${{ gitea.sha }} + docker push gitea.niq-dev.com/gitea_admin/landing:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d35850d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx:1.27-alpine +COPY index.html /usr/share/nginx/html/index.html diff --git a/index.html b/index.html new file mode 100644 index 0000000..04e0409 --- /dev/null +++ b/index.html @@ -0,0 +1,28 @@ + + + + +niq-dev.com + + + + +

niq-dev.com

+ + diff --git a/manifests/deployment.yaml b/manifests/deployment.yaml new file mode 100644 index 0000000..ea343b0 --- /dev/null +++ b/manifests/deployment.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: landing + namespace: landing +spec: + replicas: 1 + selector: + matchLabels: + app: landing + template: + metadata: + labels: + app: landing + spec: + containers: + - name: landing + image: gitea.niq-dev.com/gitea_admin/landing:latest + ports: + - containerPort: 80 +--- +apiVersion: v1 +kind: Service +metadata: + name: landing + namespace: landing +spec: + selector: + app: landing + ports: + - port: 80 + targetPort: 80 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: landing + namespace: landing + annotations: + cert-manager.io/cluster-issuer: "letsencrypt-prod" +spec: + ingressClassName: traefik + tls: + - hosts: + - www.niq-dev.com + secretName: landing-tls + rules: + - host: www.niq-dev.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: landing + port: + number: 80 diff --git a/manifests/namespace.yaml b/manifests/namespace.yaml new file mode 100644 index 0000000..4438e5a --- /dev/null +++ b/manifests/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: landing