diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..7b64415 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,31 @@ +on: + workflow_call: +jobs: + build: + runs-on: gpu + env: + #DOCKER_HOST: tcp://${{ matrix.config.host }}:2376 + CR_REGISTRY: crp8vh46gd976oq8ipla + CR_REPO: ${{ github.repository }} + IMAGE_TAG: ${{ github.sha }} + steps: + - name: Checkout + uses: actions/checkout@master + - 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:4}:${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:4}:${IMAGE_TAG::7} cr.yandex/$CR_REGISTRY/${CR_REPO:4}:latest + - name: Push image + run: | + docker push cr.yandex/$CR_REGISTRY/${CR_REPO:4}:${IMAGE_TAG::7} + docker push cr.yandex/$CR_REGISTRY/${CR_REPO:4}:latest \ No newline at end of file diff --git a/.github/workflows/notify.yaml b/.github/workflows/notify.yaml index b24f821..e546689 100644 --- a/.github/workflows/notify.yaml +++ b/.github/workflows/notify.yaml @@ -13,7 +13,7 @@ on: default: build jobs: notify: - runs-on: ubuntu:latest + runs-on: gpu steps: - uses: mattermost/action-mattermost-notify@master with: