Deploy to prod #2420
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to prod | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 2 * * *' | |
push: | |
branches: | |
- latest | |
jobs: | |
deploy: | |
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}} | |
S3_CZ_PATH: ${{ secrets.S3_DOCX_PATH }} | |
TARANTOOL_UPDATE_KEY: ${{secrets.TARANTOOL_UPDATE_KEY}} | |
TARANTOOL_UPDATE_URL: ${{secrets.TARANTOOL_UPDATE_URL}} | |
DEPLOYMENT_NAME: latest | |
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: Fetch submodules | |
id: fetch-submodules | |
run: git fetch --recurse-submodules | |
- 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: make pdf | |
id: make-pdf | |
- run: make pdf-ru | |
id: make-pdf-ru | |
- run: make singlehtml | |
id: make-singlehtml | |
- run: make singlehtml-ru | |
id: make-singlehtml-ru | |
- run: bash upload_output.sh | |
id: upload-output | |
- name: Update production 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: 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) }} |