Fix CI/CD workflow
All checks were successful
Docker Build and Push (Multi-architecture) / build-and-push (push) Successful in 27s
All checks were successful
Docker Build and Push (Multi-architecture) / build-and-push (push) Successful in 27s
This commit is contained in:
@@ -41,23 +41,23 @@ jobs:
|
|||||||
${{ vars.REGISTRY }}/${{ github.repository_owner }}/${{ vars.IMAGE_NAME }}:${{ github.sha }}
|
${{ vars.REGISTRY }}/${{ github.repository_owner }}/${{ vars.IMAGE_NAME }}:${{ github.sha }}
|
||||||
|
|
||||||
- name: Deploy to Portainer
|
- name: Deploy to Portainer
|
||||||
id: deploy
|
run: |
|
||||||
uses: fjogeleit/http-request-action@v1
|
STACK_RESPONSE=$(curl -s -X GET \
|
||||||
with:
|
"${{ vars.PORTAINER_URL }}/api/stacks" \
|
||||||
url: ${{ vars.PORTAINER_URL }}/api/stacks/${{ vars.STACK_ID }}/git/redeploy
|
-H "X-API-Key: ${{ secrets.PORTAINER_API_KEY }}")
|
||||||
method: POST
|
|
||||||
customHeaders: '{
|
STACK_ID=$(echo $STACK_RESPONSE | jq -r '.[] | select(.Name == "${{ vars.STACK_NAME }}") | .Id')
|
||||||
"X-API-Key": "${{ secrets.PORTAINER_API_KEY }}",
|
|
||||||
"Content-Type": "application/json"
|
curl -X PUT \
|
||||||
}'
|
"${{ vars.PORTAINER_URL }}/api/endpoints/${{ vars.ENDPOINT_ID }}/stacks/$STACK_ID" \
|
||||||
data: '{
|
-H "X-API-Key: ${{ secrets.PORTAINER_API_KEY }}" \
|
||||||
"env": [
|
-H "Content-Type: application/json" \
|
||||||
{"name": "IMAGE_TAG", "value": "${{ github.sha }}"},
|
-d '{
|
||||||
{"name": "DEPLOY_TIMESTAMP", "value": "${{ github.run_id }}"}
|
"pullImage": true,
|
||||||
],
|
"prune": true
|
||||||
"prune": true,
|
}'
|
||||||
"pullImage": true
|
|
||||||
}'
|
echo "Deployment triggered for stack ID: $STACK_ID"
|
||||||
continue-on-error: false
|
continue-on-error: false
|
||||||
|
|
||||||
- name: Verify deployment
|
- name: Verify deployment
|
||||||
|
|||||||
Reference in New Issue
Block a user