From eb8566423f21ffa23ec9062bd4379e799557aa15 Mon Sep 17 00:00:00 2001 From: Pepe Ziberi Date: Sun, 29 Mar 2026 07:00:07 +0200 Subject: [PATCH] ci: add action for portainer deployment --- .gitea/workflows/deploy.yml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..8792c67 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,44 @@ +name: Build and Deploy to Portainer + +on: + push: + branches: + - main + +jobs: + build-and-deploy: + # Falls Ihr Runner ein anderes Label hat (z.B. 'docker', 'linux'), + # ändern Sie 'ubuntu-latest' entsprechend ab. + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Gitea Container Registry + uses: docker/login-action@v3 + with: + # Hier ist die lokale IP-Adresse der Registry hinterlegt. + # Alternativ git.purepixel.ch (je nach Gitea/Docker Setup) + registry: 192.168.1.183:3100 + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: 192.168.1.183:3100/adminpepe/lageplan:latest + # Caching für schnellere Builds (optional) + cache-from: type=registry,ref=192.168.1.183:3100/adminpepe/lageplan:buildcache + cache-to: type=registry,ref=192.168.1.183:3100/adminpepe/lageplan:buildcache,mode=max + + - name: Trigger Portainer Webhook + run: | + echo "Triggering Portainer to pull the latest image and update the stack..." + curl -S -X POST "${{ secrets.PORTAINER_WEBHOOK }}"