name: Build and Deploy on: push: branches: - main jobs: build: runs-on: linux container: image: catthehacker/ubuntu:act-latest options: --privileged # Required for Docker-in-Docker steps: - name: Checkout code uses: actions/checkout@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Log in to Gitea Container Registry uses: docker/login-action@v2 with: registry: gitea.abzk.fr username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push Docker image uses: docker/build-push-action@v4 with: context: . file: ./Dockerfile push: true tags: gitea.abzk.fr/mrzaiko/jarvis:latest - name: Deploy to Portainer run: | curl -s -X POST "http://192.168.1.17:9000/api/stacks/27/redeploy" \ -H "X-API-Key: ${{ secrets.PORTAINER_API_KEY }}" \ -H "Content-Type: application/json" \ -d '{}'