Skip to content

chore(cicd): Move image tag to env var #11

chore(cicd): Move image tag to env var

chore(cicd): Move image tag to env var #11

Workflow file for this run

name: Build and Deploy to Yandex Cloud Serverless Containers
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
env:
IMAGE_NAME: cr.yandex/${{ vars.REGISTRY_ID }}/${{ vars.CONTAINER_NAME }}:${{ vars.IMAGE_TAG }}
steps:
- 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: Check out the code
uses: actions/checkout@v3
- name: Build, tag, and push image to Yandex Cloud Container Registry
run: |
docker build -t $IMAGE_NAME .
docker push $IMAGE_NAME
- 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 }}
revision-service-account-id: ${{ vars.SERVICE_ACCOUNT_ID }}
revision-image-url: ${{ env.IMAGE_NAME }}
container-name: ${{ vars.CONTAINER_NAME }}
folder-id: ${{ vars.FOLDER_ID }}
revision-cores: 1
revision-memory: 2048Mb
revision-core-fraction: 100
revision-concurrency: 2
revision-execution-timeout: 60