This commit is contained in:
41
.gitea/workflows/build-and-push.yml
Normal file
41
.gitea/workflows/build-and-push.yml
Normal 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
11
Dockerfile
Normal 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
25
index.html
Normal 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>
|
||||
Reference in New Issue
Block a user