From 82398b046a440f33198b62c0b9a8de41adbaed8e Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 7 Aug 2024 20:55:29 -0700 Subject: [PATCH] Fail the job if he deploy fails --- .github/actions/swarm-deploy/action.yml | 2 +- .github/workflows/cd-swarm-deploy.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/swarm-deploy/action.yml b/.github/actions/swarm-deploy/action.yml index 96d2d7fb..a1ebc76d 100644 --- a/.github/actions/swarm-deploy/action.yml +++ b/.github/actions/swarm-deploy/action.yml @@ -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 diff --git a/.github/workflows/cd-swarm-deploy.yml b/.github/workflows/cd-swarm-deploy.yml index 91757e2a..c4a4f0a6 100644 --- a/.github/workflows/cd-swarm-deploy.yml +++ b/.github/workflows/cd-swarm-deploy.yml @@ -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