-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.28 KB
/
main.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
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