From 747b272f5bc680b8889522edb4b7141dc7ad93e0 Mon Sep 17 00:00:00 2001 From: Eugene Michkov Date: Mon, 26 Aug 2024 22:44:55 +0300 Subject: [PATCH] ci: test successful deployment --- .github/workflows/deploy.yml | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..a6f1450 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,40 @@ +name: Deploy + +on: + push: + branches: + - production + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - 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') + + - name: Create new deployment status + run: | + gh api --method POST \ + -H "Accept: application/vnd.github+json" \ + /repos/${{ github.repository }}/deployments/${{ env.DEPLOYMENT_ID }}/statuses \ + -f "state=pending" + -f "auto_inactive=true" + + - name: Fake deployment + run: | + sleep 10 + + - name: Update deployment status + run: | + gh api --method POST \ + -H "Accept: application/vnd.github+json" \ + /repos/${{ github.repository }}/deployments/${{ env.DEPLOYMENT_ID }}/statuses \ + -f "state=success" + -f "auto_inactive=true"