fix(ci): force image pull via Portainer API (stop + pull + start)
CI/CD Pipeline / Build & Deploy (push) Failing after 41s
CI/CD Pipeline / Build & Deploy (push) Failing after 41s
This commit is contained in:
@@ -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 }}"
|
||||
|
||||
Reference in New Issue
Block a user