name: Push To Yandex Cloud CR on: pull_request: 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: ${{ vars.CR_REGISTRY }} 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: ${{ vars.FOLDER_ID }} revision-service-account-id: ${{ vars.SERVICE_ACCOUNT }} revision-cores: 1 revision-memory: 128Mb revision-core-fraction: 100 revision-concurrency: 1 revision-image-url: cr.yandex/${{ vars.CR_REGISTRY }}/mtg-price-bot:${{ github.sha }} revision-execution-timeout: 10 revision-secrets: | TELOXIDE_TOKEN=${{ vars.SECRET }}/${{ vars.REVISION }}/TELOXIDE_TOKEN VK_TOKEN=${{ vars.SECRET }}/${{ vars.REVISION }}/VK_TOKEN VK_GROUP_ID=${{ vars.SECRET }}/${{ vars.REVISION }}/VK_GROUP_ID VK_SECRET=${{ vars.SECRET }}/${{ vars.REVISION }}/VK_SECRET VK_CONFIRMATION_STRING=${{ vars.SECRET }}/${{ vars.REVISION }}/VK_CONFIRMATION_STRING TG_SECRET=${{ vars.SECRET }}/${{ vars.REVISION }}/TG_SECRET SCG_CLIENT_GUID=${{ vars.SECRET }}/${{ vars.REVISION }}/SCG_CLIENT_GUID - 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: ${{ vars.FOLDER_ID }} spec-file: apigw.yaml