From 4ab5f40782dae8fe1f9dca4431c3850d68dd61e4 Mon Sep 17 00:00:00 2001 From: Robin Schanbacher Date: Thu, 3 Sep 2026 13:29:27 +0000 Subject: [PATCH] fix: switch to docker cli build --- .gitea/workflows/deploy.yaml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 474f7fe..d0768fc 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -15,7 +15,6 @@ jobs: with: repository: ${{ github.repository }} token: ${{ secrets.GITEA_TOKEN }} - # Nutze den Container-Namen "gitea" anstelle der IP/Host-Adresse repository-url: http://gitea:3000/${{ github.repository }} ref: main @@ -24,24 +23,24 @@ jobs: VERSION=$(jq -r '.version' package.json) echo "VERSION=$VERSION" >> $GITHUB_ENV - - name: Configure Docker Insecure Registry + - name: Build and Push Docker Image via CLI run: | - mkdir -p /etc/docker - echo '{"insecure-registries": ["gitea:3000"]}' | sudo tee /etc/docker/daemon.json - sudo systemctl restart docker || true + IMAGE_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') + + # Insecure Registry Flag in Docker-CLI erzwingen + echo '{"insecure-registries": ["gitea:3000"]}' > /etc/docker/daemon.json 2>/dev/null || true - - name: Log in to Gitea Container Registry - run: | + echo "Logging into Gitea Registry..." echo "${{ secrets.GITEA_TOKEN }}" | docker login gitea:3000 -u ${{ github.actor }} --password-stdin - - name: Build and Push Docker Image - uses: docker/build-push-action@v5 - with: - context: . - push: true - tags: | - gitea:3000/${{ github.repository }}:v${{ env.VERSION }} - gitea:3000/${{ github.repository }}:latest + echo "Building Docker Image..." + docker build \ + -t gitea:3000/$IMAGE_NAME:v${{ env.VERSION }} \ + -t gitea:3000/$IMAGE_NAME:latest . + + echo "Pushing Docker Image..." + docker push gitea:3000/$IMAGE_NAME:v${{ env.VERSION }} + docker push gitea:3000/$IMAGE_NAME:latest create-release: name: Create Gitea Release @@ -66,7 +65,6 @@ jobs: PRERELEASE="false" fi - # API-Aufruf über den Hostnamen "gitea" HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ "http://gitea:3000/api/v1/repos/${{ github.repository }}/releases/tags/v$VERSION") -- 2.54.1