Workflow #7
@@ -1,41 +1,27 @@
|
|||||||
name: Build and Push Docker Image
|
name: Docker Build & Push
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Code auschecken
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Log in to Gitea Container Registry
|
- name: Bei Gitea Container Registry anmelden
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ${{ gitea.server_url }}
|
registry: ${{ gitea.server_url }}
|
||||||
username: ${{ gitea.actor }} # Nutzt den Namen des Pushers
|
username: ${{ gitea.actor }}
|
||||||
password: ${{ secrets.GITEA_TOKEN }} # Oder ${{ gitea.token }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Extract Metadata (Tags/Labels)
|
- name: Docker Image bauen und pushen
|
||||||
id: meta
|
uses: docker/build-push-action@v4
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: ${{ gitea.server_url }}/${{ gitea.repository }}
|
|
||||||
tags: |
|
|
||||||
type=raw,value=latest
|
|
||||||
type=ref,event=branch
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
|
|
||||||
- name: Build and Push Docker Image
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ gitea.server_url }}/${{ gitea.repository }}:latest
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
Reference in new issue
Block a user