Skip to content

Custom-deploy-branch #167

Custom-deploy-branch

Custom-deploy-branch #167

Workflow file for this run

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) }}