ci: mirror image to cr.yandex when YC secrets set
Build and Publish Image / build (push) Successful in 29s

This commit is contained in:
2026-06-24 15:05:20 -04:00
parent 6401eef524
commit f895b9a49f
+11 -1
View File
@@ -28,7 +28,7 @@ jobs:
type=ref,event=branch
type=sha,prefix=sha-
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
- name: Build and push (Gitea registry)
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_RECORD_UPLOAD: "false"
@@ -40,3 +40,13 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Mirror to Yandex Container Registry (cr.yandex)
env:
YC_CR_ID: ${{ secrets.YC_CR_ID }}
YC_SA_KEY: ${{ secrets.YC_SA_KEY }}
run: |
if [ -z "$YC_CR_ID" ] || [ -z "$YC_SA_KEY" ]; then
echo "YC_CR_ID / YC_SA_KEY не заданы — пропускаю пуш в cr.yandex"; exit 0; fi
echo "$YC_SA_KEY" | docker login cr.yandex --username json_key --password-stdin
docker buildx imagetools create --tag cr.yandex/$YC_CR_ID/xray-edge:latest git.qomar.pw/${{ github.repository }}:latest
echo "OK -> cr.yandex/$YC_CR_ID/xray-edge:latest"