From c0667d23cbfa5a47a02d487a9f97f8750fed351c Mon Sep 17 00:00:00 2001 From: Gyeongho Yang Date: Thu, 5 Dec 2024 15:17:11 +0900 Subject: [PATCH] fix: add status scripts --- .github/workflows/be-cd.yaml | 9 ++++++--- .github/workflows/fe-cd.yaml | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) 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