-
Notifications
You must be signed in to change notification settings - Fork 44
56 lines (51 loc) · 1.92 KB
/
destroy-deployment-manually.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Destroy-deployment-manually
on:
workflow_dispatch:
inputs:
deployment_name:
description: 'Enter the name of GitHub deployment to remove'
required: True
jobs:
destroy-deployment-manually:
runs-on: ubuntu-latest
env:
# we only remove deployments from the test site, never from prod
TARANTOOL_UPDATE_URL: ${{secrets.TARANTOOL_DEVELOP_UPDATE_URL}}
TARANTOOL_UPDATE_KEY: ${{secrets.TARANTOOL_UPDATE_KEY}}
VKTEAMS_BOT_TOKEN: ${{secrets.VKTEAMS_TARANTOOLBOT_TOKEN}}
steps:
- uses: actions/checkout@v3
id: checkout
with:
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Update inputs
id: update-inputs
run: |
echo "DEPLOYMENT_NAME=${{github.event.inputs.deployment_name}}" >> $GITHUB_ENV
echo "workaround until actions/runner#655 is fixed"
- name: Remove dev server deployment with version ${{env.DEPLOYMENT_NAME}}
uses: nick-fields/retry@v2
id: delete-deployment-webhook
with:
command: bash webhooks/delete_deployment.sh
timeout_seconds: 30
retry_wait_seconds: 30
max_attempts: 3
- name: Remove GitHub deployment at ${{env.DEPLOYMENT_NAME}}
uses: bobheadxi/[email protected]
# remove GH deployment even if webhook failed
if: always()
id: remove-github-deployment
with:
step: delete-env
token: ${{ secrets.GITHUB_TOKEN }}
env: "${{ env.DEPLOYMENT_NAME }}"
- name: Send VK Teams message on failures
# bot token won't be accessible in the forks
if: ${{ failure() && env.VKTEAMS_BOT_TOKEN != '' }}
uses: tarantool/actions/report-job-status@master
with:
api-url: "https://api.internal.myteam.mail.ru/bot/v1/"
bot-token: ${{ env.VKTEAMS_BOT_TOKEN }}
chat-id: tt_docs_cicd_reports
job-steps: ${{ ToJson(steps) }}