From 971e32ecd1a0f89c875b4b21c1d9473dcf0aacb7 Mon Sep 17 00:00:00 2001 From: kandrusyak Date: Tue, 28 Jul 2026 00:53:25 +0300 Subject: [PATCH] ci: use shell checkout in docker build job --- .github/workflows/delivery.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/delivery.yml b/.github/workflows/delivery.yml index f4d7b66..2f6605d 100644 --- a/.github/workflows/delivery.yml +++ b/.github/workflows/delivery.yml @@ -43,8 +43,15 @@ jobs: timeout-minutes: 30 steps: - - uses: actions/checkout@v4 + - name: Check out the exact commit + shell: sh + run: | + git init . + git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git" + git fetch --depth 1 origin "$GITHUB_SHA" + git checkout --detach FETCH_HEAD - name: Log in to the container registry + shell: sh env: REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} run: | @@ -52,6 +59,7 @@ jobs: printf '%s' "$REGISTRY_TOKEN" | docker login "$REGISTRY" --username admin --password-stdin - name: Build the cloud image + shell: sh run: | docker build \ --target yandex \ @@ -61,11 +69,13 @@ jobs: --tag "$IMAGE:latest" \ . - name: Push immutable and latest tags + shell: sh run: | docker push "$IMAGE:$GITHUB_SHA" docker push "$IMAGE:latest" - name: Log out from the container registry if: ${{ always() }} + shell: sh run: docker logout "$REGISTRY" || true deploy: