-
Notifications
You must be signed in to change notification settings - Fork 43
120 lines (109 loc) · 4.13 KB
/
deploy-custom.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Custom-deploy-branch
on:
workflow_dispatch:
inputs:
deployment_name:
description: 'Enter unique name (version) of deployment'
required: True
cartridge:
description: 'Cartridge branch or commit'
required: false
cartridge_cli:
description: "Cartridge-cli branch or commit"
required: false
grafana:
description: "Grafana branch or commit"
required: false
luatest:
description: "Luatest branch or commit"
required: false
metrics:
description: "Metrics branch or commit"
required: false
cpp_driver:
description: "Cpp driver branch or commit"
required: false
jobs:
custom-deploy-branch:
runs-on: ubuntu-latest
container: tarantool/doc-builder:fat-4.3
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}}
S3_ENDPOINT_URL: ${{secrets.S3_ENDPOINT_URL}}
S3_UPLOAD_PATH: ${{secrets.S3_UPLOAD_PATH}}
TARANTOOL_UPDATE_KEY: ${{secrets.TARANTOOL_UPDATE_KEY}}
TARANTOOL_UPDATE_URL: ${{secrets.TARANTOOL_DEVELOP_UPDATE_URL}}
VKTEAMS_BOT_TOKEN: ${{secrets.VKTEAMS_TARANTOOLBOT_TOKEN}}
steps:
- name: Prevent dubious ownership
id: add-safe-directory
run: git config --global --add safe.directory '*'
- uses: actions/checkout@v3
id: checkout
with:
submodules: recursive
- name: Pull submodules
id: pull-submodules
run: |
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch --recurse-submodules
- name: Update workflow inputs
id: update-workflow-inputs
run: |
echo "workaround until actions/runner#655 is fixed"
echo "DEPLOYMENT_NAME=${{github.event.inputs.deployment_name}}" >> $GITHUB_ENV
echo "INPUT_CARTRIDGE=${{github.event.inputs.cartridge}}" >> $GITHUB_ENV
echo "INPUT_CARTRIDGE_CLI=${{github.event.inputs.cartridge_cli}}" >> $GITHUB_ENV
echo "INPUT_GRAFANA=${{github.event.inputs.grafana}}" >> $GITHUB_ENV
echo "INPUT_LUATEST=${{github.event.inputs.luatest}}" >> $GITHUB_ENV
echo "INPUT_METRICS=${{github.event.inputs.metrics}}" >> $GITHUB_ENV
echo "INPUT_CPP_DRIVER=${{github.event.inputs.cpp_driver}}" >> $GITHUB_ENV
- name: Start dev server deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
token: ${{secrets.GITHUB_TOKEN}}
env: ${{env.DEPLOYMENT_NAME}}
ref: ${{github.head_ref}}
- run: cmake .
id: cmake
- run: make pull-modules
id: make-pull-modules
- run: make build-modules
id: make-build-modules
- run: make json
id: make-json
- run: make json-ru
id: make-json-ru
- run: bash upload_output.sh
id: upload-output
- name: Create or update a dev server deployment with version ${{env.DEPLOYMENT_NAME}}
uses: nick-fields/retry@v2
id: update-deployment-webhook
with:
command: bash webhooks/update_deployment.sh
timeout_seconds: 15
retry_wait_seconds: 15
max_attempts: 3
- name: update deployment status
id: finalize-deployment
uses: bobheadxi/deployments@v1
with:
step: finish
token: ${{secrets.GITHUB_TOKEN}}
env: ${{env.DEPLOYMENT_NAME}}
status: ${{job.status}}
deployment_id: ${{steps.deployment.outputs.deployment_id}}
env_url: ${{secrets.TARANTOOL_HOST}}/doc/${{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) }}