diff --git a/.github/workflows/be-cd.yaml b/.github/workflows/be-cd.yaml index 6b8f3b9..2ff18f4 100644 --- a/.github/workflows/be-cd.yaml +++ b/.github/workflows/be-cd.yaml @@ -11,6 +11,10 @@ on: - server/docker/docker-compose-be.yaml - server/docker/docker-compose-db.yaml +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + jobs: deploy: runs-on: ubuntu-latest @@ -72,6 +76,5 @@ jobs: || docker stack deploy -c docker-compose-be.yaml ${REPO_NAME} docker image prune -af - if [[ "$status" != "completed" ]]; then - exit 1 - fi + docker service inspect mapletool_be --format '{{.UpdateStatus.State}}' \ + | grep -qv 'completed' && exit 1 diff --git a/.github/workflows/fe-cd.yaml b/.github/workflows/fe-cd.yaml index 2d55117..95702ed 100644 --- a/.github/workflows/fe-cd.yaml +++ b/.github/workflows/fe-cd.yaml @@ -10,6 +10,10 @@ on: - .github/workflows/fe-cd.yaml - server/docker/docker-compose-fe.yaml +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + jobs: deploy: runs-on: ubuntu-latest