Skip to content

chore: Move github env access in workflow #7

chore: Move github env access in workflow

chore: Move github env access in workflow #7

Workflow file for this run

---
# yamllint disable rule:line-length
name: Build and Push Docker Image
on:
push:
tags:
- "*"
env:
TAG: GITHUB_REF##*/
jobs:
build-and-push:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Create .env file
run: |
echo "YC_ADMIN_SA_ACCESS_KEY=${{ secrets.YC_ADMIN_SA_ACCESS_KEY }}" >> .env
echo "YC_ADMIN_SA_SECRET_KEY=${{ secrets.YC_ADMIN_SA_SECRET_KEY }}" >> .env
echo "TELEGRAM_BOT_TOKEN=${{ secrets.TELEGRAM_BOT_TOKEN }}" >> .env
echo "BUCKET=${{ secrets.BUCKET }}" >> .env
- name: Log docker in to the Yandex Cloud Registry
run: echo "${{ secrets.YC_OAUTH_TOKEN }}" | docker login --username oauth --password-stdin cr.yandex
- name: Build Docker image
run: docker build --quiet -t cr.yandex/${{ secrets.YC_REGISTRY_ID }}/${{ github.event.repository.name }}:${{ env.TAG }} .
- name: Push Docker image to the Registry
run: docker push --quiet cr.yandex/${{ secrets.YC_REGISTRY_ID }}/${{ github.event.repository.name }}:${{ env.TAG }}