47 lines
1.7 KiB
YAML
47 lines
1.7 KiB
YAML
on:
|
|
workflow_call:
|
|
jobs:
|
|
build:
|
|
runs-on: gpu
|
|
env:
|
|
#DOCKER_HOST: tcp://${{ matrix.config.host }}:2376
|
|
CR_REGISTRY: crp8vh46gd976oq8ipla
|
|
CR_REPO: ${{ github.event.repository.name }}
|
|
IMAGE_TAG: ${{ github.sha }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@master
|
|
- name: Checkout LFS
|
|
run: |
|
|
UrlBase=$GITHUB_SERVER_URL; \
|
|
UrlLfsBase=$UrlBase/${{ github.repository }}.git/info/lfs/objects; \
|
|
Auth=`/usr/bin/git config --get --local http.$UrlBase/.extraheader`; \
|
|
/usr/bin/git config --local http.${UrlLfsBase}/batch.extraheader "$Auth"; \
|
|
/usr/bin/git config --local http.${UrlLfsBase}/.extraheader ''
|
|
|
|
git config --local lfs.transfer.maxretries 1
|
|
|
|
/usr/bin/git lfs fetch origin refs/remotes/origin/${{ github.ref_name }}
|
|
/usr/bin/git lfs checkout
|
|
- name: Use ssh key
|
|
uses: webfactory/ssh-agent@v0.9.0
|
|
with:
|
|
ssh-private-key: ${{ secrets.LIB_SSH_KEY }}
|
|
- name: Build image
|
|
run: |
|
|
docker build -t cr.yandex/$CR_REGISTRY/$CR_REPO:${IMAGE_TAG::7} --ssh default .
|
|
- name: Yandex Cloud Login
|
|
uses: yc-actions/yc-cr-login@v2
|
|
with:
|
|
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
|
|
- name: Tag image
|
|
run: |
|
|
docker tag cr.yandex/$CR_REGISTRY/$CR_REPO:${IMAGE_TAG::7} cr.yandex/$CR_REGISTRY/$CR_REPO:latest
|
|
- name: Push image
|
|
run: |
|
|
docker push cr.yandex/$CR_REGISTRY/$CR_REPO:${IMAGE_TAG::7}
|
|
docker push cr.yandex/$CR_REGISTRY/$CR_REPO:latest
|
|
|
|
|
|
|
|
|