64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
name: Docker Build & Push
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Code auschecken
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Bei Gitea Container Registry anmelden
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: 127.0.0.1:3000
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.token }}
|
|
|
|
- name: Docker Image bauen (nur lokal im Runner)
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
push: false
|
|
tags: |
|
|
127.0.0.1:3000/rudi/tandur:${{ gitea.ref_name }}
|
|
127.0.0.1:3000/rudi/tandur:latest
|
|
|
|
- name: Images zu Gitea pushen
|
|
run: |
|
|
docker push 127.0.0.1:3000/rudi/tandur:${{ gitea.ref_name }}
|
|
docker push 127.0.0.1:3000/rudi/tandur:latest
|
|
|
|
release:
|
|
if: startsWith(gitea.ref, 'refs/tags/v')
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Code auschecken
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Gitea Release erstellen
|
|
uses: https://gitea.com/actions/gitea-release-action@main
|
|
with:
|
|
api_key: '${{ secrets.TOKEN }}'
|
|
files: |-
|
|
docker-compose.yaml
|
|
body: |
|
|
## Docker Image:
|
|
|
|
```bash
|
|
docker pull git.schamagusa.de/rudi/tandur:latest
|
|
```
|
|
## Docker Compose
|
|
Download the `docker-compose.yaml`
|
|
and then
|
|
```bash
|
|
docker compose pull
|
|
docker compose up -d
|
|
```
|