fix(ci): force image pull via Portainer API (stop + pull + start)
CI/CD Pipeline / Build & Deploy (push) Failing after 41s

This commit is contained in:
wh-leader
2026-05-11 13:06:15 +02:00
parent 35f3ba8767
commit 42873ad9cc
+14 -2
View File
@@ -34,6 +34,18 @@ jobs:
tags: |
gitlab.impresion3d.pro/root/davidaragon-portfolio:latest
- name: Redeploy via Portainer webhook
- name: Stop Portainer stack
run: |
curl --max-time 10 -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}" || true
curl -X POST "${{ secrets.PORTAINER_URL }}/api/stacks/${{ secrets.PORTAINER_STACK_ID }}/stop?endpointId=${{ secrets.PORTAINER_ENDPOINT_ID }}" \
-H "X-API-Key: ${{ secrets.PORTAINER_TOKEN }}"
sleep 5
- name: Pull fresh image
run: |
curl -X POST "${{ secrets.PORTAINER_URL }}/api/endpoints/${{ secrets.PORTAINER_ENDPOINT_ID }}/docker/images/create?fromImage=gitlab.impresion3d.pro%2Froot%2Fdavidaragon-portfolio&tag=latest" \
-H "X-API-Key: ${{ secrets.PORTAINER_TOKEN }}"
- name: Start Portainer stack
run: |
curl -X POST "${{ secrets.PORTAINER_URL }}/api/stacks/${{ secrets.PORTAINER_STACK_ID }}/start?endpointId=${{ secrets.PORTAINER_ENDPOINT_ID }}" \
-H "X-API-Key: ${{ secrets.PORTAINER_TOKEN }}"