testing
Some checks failed
Build and Deploy koneko.rocks / build-and-deploy (push) Has been cancelled

This commit is contained in:
koneko 2025-04-23 17:57:34 +02:00
parent 8850a5d1f7
commit 63e50ad510
4 changed files with 70 additions and 0 deletions

View File

@ -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

2
Dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM nginx:alpine
COPY index.html /usr/share/nginx/html/index.html

17
docker-compose.yml Normal file
View File

@ -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)

11
index.html Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>koneko.rocks</title>
</head>
<body>
Landing page. If you are seeing this, traefik and DDNS are working as intended. :)
</body>
</html>