Skip to content

add checks ci action #9

add checks ci action

add checks ci action #9

Workflow file for this run

name: Deploy
permissions:
contents: read
pull-requests: read
on:
pull_request:
types:
- closed
branches:
- 'main'
jobs:
deploy:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: "Get the commit hash of the merged pull request"
id: get_commit_hash
shell: bash
run: |
echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Extract Metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: |
cr.yandex/${{ vars.YC_REGISTRY_ID }}/${{ github.event.repository.name }}
tags: |
type=raw,value=pr-${{ github.event.pull_request.number }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: cr.yandex
username: ${{ vars.YC_REGISTRY_USERNAME }}
password: ${{ secrets.YC_REGISTRY_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
file: ./Dockerfile
context: .
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}