From 55560946b40822e22be231fb853877d3100a3bf4 Mon Sep 17 00:00:00 2001 From: Eugene Michkov Date: Mon, 26 Aug 2024 23:07:09 +0300 Subject: [PATCH] ci: fix --- .github/workflows/deploy.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3c47847..232319f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,13 +10,19 @@ jobs: runs-on: ubuntu-latest steps: + - name: Remove old deployment + run: | + PREVIOUS_DEPLOYMENT_ID=$(gh api /repos/ParzivalEugene/michkoff-links/deployments | jq -r '.[0].id') + gh api --method DELETE /repos/ParzivalEugene/michkoff-links/deployments/${PREVIOUS_DEPLOYMENT_ID} || true + env: + GH_TOKEN: ${{ github.token }} + - name: Create new deployment run: | gh api --method POST \ -H "Accept: application/vnd.github+json" \ /repos/${{ github.repository }}/deployments \ -f "ref=production" \ - -f "environment=production" DEPLOYMENT_ID=$(gh api /repos/ParzivalEugene/michkoff-links/deployments | jq -r '.[0].id') env: DEPLOYMENT_ID: ${{ steps.create.outputs.DEPLOYMENT_ID }}