Skip to content

Commit

Permalink
Fail the job if he deploy fails
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwi committed Aug 8, 2024
1 parent dd1dbb6 commit 82398b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/actions/swarm-deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runs:
jq '.Spec.TaskTemplate.ContainerSpec.Image="${{ inputs.IMAGE_TAG}}" | .Spec' service.spec.json > update.spec.json
curl -v -f -s -X POST -H "X-API-Key: ${{env.PORTAINER_API_KEY}}" -H "Content-Type: application/json" ${{inputs.PORTAINER_DOMAIN_PROTOCOL}}://${{inputs.PORTAINER_DOMAIN}}/api/endpoints/${{env.ENDPOINT_ID}}/docker/services/${{ inputs.STACK_NAME }}/update?version=$version -d @update.spec.json
curl -f -s -X POST -H "X-API-Key: ${{env.PORTAINER_API_KEY}}" -H "Content-Type: application/json" ${{inputs.PORTAINER_DOMAIN_PROTOCOL}}://${{inputs.PORTAINER_DOMAIN}}/api/endpoints/${{env.ENDPOINT_ID}}/docker/services/${{ inputs.STACK_NAME }}/update?version=$version -d @update.spec.json
echo PREVIOUS_IMAGE=$previousimg >> $GITHUB_OUTPUT
echo DEPLOYED_DATE=$(date -u) >> $GITHUB_OUTPUT
2 changes: 1 addition & 1 deletion .github/workflows/cd-swarm-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: signalwire/actions-template
ref: ryanwi/fail-deploy
ref: main
path: actions

- uses: ./actions/.github/actions/approval
Expand Down

0 comments on commit 82398b0

Please sign in to comment.