.gitea/workflows/linux_arm64_docker-release.yaml aktualisiert
Some checks failed
Build ARM64 Linux / build-arm64 (push) Has been cancelled
Build Docker Linux ARM64 / build-docker-linux-arm64 (push) Has been cancelled
Build Linux x64 / build-linux-x64 (push) Has been cancelled
Build Windows x64 / build-windows-x64 (push) Has been cancelled
Build Docker Linux ARM64 Release / build-docker-linux-arm64-release (push) Failing after 46s
Some checks failed
Build ARM64 Linux / build-arm64 (push) Has been cancelled
Build Docker Linux ARM64 / build-docker-linux-arm64 (push) Has been cancelled
Build Linux x64 / build-linux-x64 (push) Has been cancelled
Build Windows x64 / build-windows-x64 (push) Has been cancelled
Build Docker Linux ARM64 Release / build-docker-linux-arm64-release (push) Failing after 46s
This commit is contained in:
@@ -8,78 +8,96 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-docker-linux-arm64-release:
|
build-docker-linux-arm64-release:
|
||||||
runs-on: [self-hosted, linux, arm64, docker]
|
runs-on: [self-hosted, linux, arm64, docker]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # Nötig, um das Release zu erstellen
|
contents: write
|
||||||
packages: write # Nötig, um in die Container Registry zu pushen
|
packages: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install required packages
|
||||||
run: apk add --no-cache git curl wget unzip bash nodejs npm docker
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
if command -v apk >/dev/null 2>&1; then
|
||||||
|
echo "Using apk (Alpine)"
|
||||||
|
apk add --no-cache \
|
||||||
|
git curl wget unzip bash nodejs npm docker
|
||||||
|
elif command -v apt-get >/dev/null 2>&1; then
|
||||||
|
echo "Using apt (Debian/Ubuntu)"
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y \
|
||||||
|
git curl wget unzip bash nodejs npm docker.io
|
||||||
|
else
|
||||||
|
echo "Unsupported OS package manager"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# 1. Login bei der Gitea Registry
|
# Login to Gitea Container Registry
|
||||||
- name: Bei Gitea Container Registry anmelden
|
- name: Login to Gitea Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ gitea.server_url }}
|
registry: ${{ github.server_url }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# 2. Metadaten berechnen (sorgt für korrekte Tags wie :v1.0 und :latest)
|
# Docker metadata
|
||||||
- name: Metadaten für Docker extrahieren
|
- name: Extract Docker metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ gitea.server_url }}/${{ github.repository }}
|
images: ${{ github.server_url }}/${{ github.repository }}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=raw,value=latest,enable=${{ github.ref == format('refs/tags/{0}', github.ref_name) }}
|
type=raw,value=latest
|
||||||
|
|
||||||
# 3. Setup Docker Buildx (verbessert Performance und Caching)
|
# Buildx
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
# 4. Bauen und PUSHEN in die Registry
|
# Build & Push
|
||||||
# Wir nutzen hier 'load: true', um das Image danach auch für 'docker save' verfügbar zu haben,
|
- name: Build and Push Docker Image
|
||||||
# und pushen es danach separat, oder wir bauen es direkt.
|
|
||||||
# Da build-push-action "push" und "load" (lokal speichern) oft nicht gleichzeitig kann,
|
|
||||||
# ist es am sichersten, das Image zu bauen und direkt zu pushen.
|
|
||||||
- name: Build and Push to Registry
|
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true # Lädt es direkt in Gitea "Pakete" hoch
|
platforms: linux/arm64
|
||||||
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
# 5. Optional: Image zusätzlich als .tar bauen für den Release-Anhang
|
# Build local image for tarball
|
||||||
# (Falls Sie die Datei wirklich noch als Download brauchen)
|
- name: Build local Docker image
|
||||||
- name: Build local for Tarball
|
|
||||||
run: docker build -t couchlog-linux-arm64 .
|
run: docker build -t couchlog-linux-arm64 .
|
||||||
|
|
||||||
- name: Save Docker Image to Tar
|
- name: Save Docker image as tar
|
||||||
run: docker save -o CouchLog-Linux-ARM64-Docker-Image.tar couchlog-linux-arm64
|
run: docker save couchlog-linux-arm64 -o CouchLog-Linux-ARM64-Docker-Image.tar
|
||||||
|
|
||||||
# 6. Release erstellen und .tar Datei anhängen
|
# Create Release (Gitea compatible)
|
||||||
- name: Release erstellen & Datei hochladen
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v2
|
id: create_release
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
# Hier war vorher der Fehler (ARM vs ARM64) - jetzt korrigiert:
|
tag_name: ${{ github.ref_name }}
|
||||||
files: CouchLog-Linux-ARM64-Docker-Image.tar
|
release_name: ${{ github.ref_name }}
|
||||||
body: |
|
|
||||||
## Docker Image
|
|
||||||
Das Image ist auch verfügbar unter:
|
|
||||||
`${{ gitea.server_url }}/${{ github.repository }}:${{ github.ref_name }}`
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker pull ${{ gitea.server_url }}/${{ github.repository }}:${{ github.ref_name }}
|
|
||||||
```
|
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
fail_on_unmatched_files: true # Warnt, wenn der Name wieder falsch ist
|
body: |
|
||||||
|
## Docker Image (ARM64)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker pull ${{ github.server_url }}/${{ github.repository }}:${{ github.ref_name }}
|
||||||
|
```
|
||||||
|
|
||||||
|
- name: Upload Docker Image Tarball
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: CouchLog-Linux-ARM64-Docker-Image.tar
|
||||||
|
asset_name: CouchLog-Linux-ARM64-Docker-Image.tar
|
||||||
|
asset_content_type: application/x-tar
|
||||||
|
|||||||
Reference in New Issue
Block a user