add files
Some checks failed
Build and Push Docker Image / build-push (push) Failing after 2m14s

This commit is contained in:
2026-04-06 15:55:47 +02:00
commit 29955208c0
3 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
name: Build and Push Docker Image
# Die Pipeline startet, wenn auf den main-Branch gepusht wird
on:
push:
branches:
- main
jobs:
build-push:
# WICHTIG: Setze hier das Label deines Gitea Runners ein (z.B. ubuntu-latest oder docker)
runs-on: ubuntu-latest
steps:
- name: Repository auschecken
uses: actions/checkout@v4
- name: Docker Buildx einrichten
uses: docker/setup-buildx-action@v3
# Login in die Gitea Container Registry
- name: Login in Gitea Registry
uses: docker/login-action@v3
with:
# WICHTIG: Ändere dies zu deiner Gitea-Domain (ohne https://)
registry: git.mrunk.de
username: ${{ gitea.actor }}
# Wir nutzen ein Secret für das Passwort (Erklärung siehe unten)
password: ${{ secrets.REGISTRY_TOKEN }}
# Image bauen und hochladen
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
push: true
# WICHTIG: Passe die Domain und den Repository-Namen an!
# Format: domain.de/benutzername/image-name:tag
tags: |
git.mrunk.de/${{ gitea.repository_owner }}/hello-world-app:latest
git.mrunk.de/${{ gitea.repository_owner }}/hello-world-app:${{ gitea.sha }}

11
Dockerfile Normal file
View File

@@ -0,0 +1,11 @@
# Wir nutzen ein kleines, leichtgewichtiges Nginx-Image
FROM nginx:alpine
# Kopiere unsere HTML-Datei in den Web-Ordner von Nginx
COPY index.html /usr/share/nginx/html/index.html
# Port 80 freigeben
EXPOSE 80
# Nginx starten
CMD ["nginx", "-g", "daemon off;"]

25
index.html Normal file
View File

@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Hello Gitea</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin-top: 50px;
}
h1 {
color: #3498db;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
<p>Dieses Image wurde von Gitea Actions gebaut und hochgeladen.</p>
</body>
</html>