diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml index 0e99d24..78b6b8f 100644 --- a/.gitea/workflows/docker-build.yml +++ b/.gitea/workflows/docker-build.yml @@ -38,4 +38,28 @@ jobs: cache-to: type=registry,ref=${{ vars.REGISTRY }}/${{ github.repository_owner }}/${{ vars.IMAGE_NAME }}:cache,mode=max tags: | ${{ vars.REGISTRY }}/${{ github.repository_owner }}/${{ vars.IMAGE_NAME }}:latest - ${{ vars.REGISTRY }}/${{ github.repository_owner }}/${{ vars.IMAGE_NAME }}:${{ github.sha }} \ No newline at end of file + ${{ vars.REGISTRY }}/${{ github.repository_owner }}/${{ vars.IMAGE_NAME }}:${{ github.sha }} + + - name: Deploy to Portainer + id: deploy + uses: fjogeleit/http-request-action@v1 + with: + url: ${{ vars.PORTAINER_URL }}/api/stacks/${{ vars.STACK_ID }}/git/redeploy + method: POST + customHeaders: '{ + "X-API-Key": "${{ secrets.PORTAINER_API_KEY }}", + "Content-Type": "application/json" + }' + data: '{ + "env": [ + {"name": "IMAGE_TAG", "value": "${{ github.sha }}"}, + {"name": "DEPLOY_TIMESTAMP", "value": "${{ github.run_id }}"} + ], + "prune": true, + "pullImage": true + }' + continue-on-error: false + + - name: Verify deployment + run: | + echo "Deployment triggered successfully for commit ${{ github.sha }}" \ No newline at end of file