mtg-price-bot/.github/workflows/deploy.yml
Artyom Belousov 301a5ce5ab Add APIGW
2023-05-29 23:18:09 +03:00

59 lines
2.2 KiB
YAML

name: Push To Yandex Cloud CR
on:
push:
branches:
- 'master'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to Yandex Cloud Container Registry
id: login-cr
uses: yc-actions/yc-cr-login@v1
with:
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
- name: Build, tag, and push image to Yandex Cloud Container Registry
env:
CR_REGISTRY: crp1s2dst54hvi8588to
CR_REPOSITORY: mtg-price-bot
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t cr.yandex/$CR_REGISTRY/$CR_REPOSITORY:$IMAGE_TAG .
docker push cr.yandex/$CR_REGISTRY/$CR_REPOSITORY:$IMAGE_TAG
- name: Deploy Serverless Container
id: deploy-sls-container
uses: yc-actions/yc-sls-container-deploy@v2
with:
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
container-name: mtg-price-bot
folder-id: b1gcl15ep29573s3s3b0
revision-service-account-id: ajet8gg42gudglvakl8e
revision-cores: 1
revision-memory: 128Mb
revision-core-fraction: 100
revision-concurrency: 1
revision-image-url: cr.yandex/crp1s2dst54hvi8588to/mtg-price-bot:${{ github.sha }}
revision-execution-timeout: 10
revision-env: |
YDB_CONNECTION_STRING=grpcs://ydb.serverless.yandexcloud.net:2135/ru-central1/b1gt05asi0tqmjs5pfv4/etn2d3t1h65d06qt14nn
revision-secrets: |
TG_TOKEN=e6qifetf07j8uiol8mg8/e6qe5k71la41vhgef0dc/TG_TOKEN
VK_SECRET_KEY=e6qifetf07j8uiol8mg8/e6qe5k71la41vhgef0dc/VK_SECRET_KEY
VK_GROUP_ID=e6qifetf07j8uiol8mg8/e6qe5k71la41vhgef0dc/VK_GROUP_ID
VK_TOKEN=e6qifetf07j8uiol8mg8/e6qe5k71la41vhgef0dc/VK_TOKEN
VK_CONFIRMATION_STRING=e6qifetf07j8uiol8mg8/e6qe5k71la41vhgef0dc/VK_CONFIRMATION_STRING
- name: Deploy API Gateway
id: deploy-gateway
uses: yc-actions/yc-api-gateway-deploy@v2.0.0
with:
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
gateway-name: mtg-price-bot
folder-id: b1gcl15ep29573s3s3b0
spec-file: apigw.yaml