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: