Add auto container redeploy to CI/CD
Some checks failed
Docker Build and Push (Multi-architecture) / build-and-push (push) Failing after 27s

This commit is contained in:
2025-09-13 15:55:27 +00:00
parent f9c99c0857
commit 9096b7259a

View File

@@ -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 }}
${{ 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 }}"