From 63e50ad5108cc4508c3ef36c8b3d2248dd29fb7b Mon Sep 17 00:00:00 2001 From: koneko <67551503+koneko@users.noreply.github.com> Date: Wed, 23 Apr 2025 17:57:34 +0200 Subject: [PATCH] testing --- .gitea/workflows/deploy.yml | 40 +++++++++++++++++++++++++++++++++++++ Dockerfile | 2 ++ docker-compose.yml | 17 ++++++++++++++++ index.html | 11 ++++++++++ 4 files changed, 70 insertions(+) create mode 100644 .gitea/workflows/deploy.yml create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 index.html diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..66fe6b7 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,40 @@ +name: Build and Deploy koneko.rocks + +on: + push: + branches: + - main + +jobs: + build-and-deploy: + runs-on: self-hosted + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Verify Docker access + run: | + echo "Checking Docker access from container..." + docker version + docker-compose version + + # use this as template if you need to build + #- name: Build project + # run: | + # echo "Running build..." + # ./build.sh + + - name: Store artifact + run: | + echo "Storing artifact..." + mkdir -p /opt/artifacts/koneko-static-site + cp -r . /opt/artifacts/koneko-static-site/ + + - name: Deploy with Docker Compose + run: | + echo "Deploying with docker-compose..." + cd /opt/artifacts/koneko-static-site + docker-compose down + docker-compose up -d --build + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5ef646a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx:alpine +COPY index.html /usr/share/nginx/html/index.html diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a9e1472 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +services: + web: + image: nginx:alpine # Use the official NGINX Alpine image + volumes: + - ./index.html:/usr/share/nginx/html/index.html # Map the local index.html to the container's directory + labels: + - "traefik.enable=true" # Enable this container to be routed by Traefik + - "traefik.http.routers.myapp.rule=Host(`koneko.rocks`)" + - "traefik.http.services.myapp.loadbalancer.server.port=80" # Expose the NGINX container on port 80 + networks: + - frontend # Connect this service to the same network as Traefik + restart: unless-stopped # Optionally restart the container if it stops + +networks: + frontend: + external: true # Use the external Traefik network (if Traefik is running on this network) + diff --git a/index.html b/index.html new file mode 100644 index 0000000..1bde64d --- /dev/null +++ b/index.html @@ -0,0 +1,11 @@ + + + + + + koneko.rocks + + + Landing page. If you are seeing this, traefik and DDNS are working as intended. :) + +