diff --git a/.github/workflows/polkadot.yml b/.github/workflows/polkadot.yml index efc6574..ebee48e 100644 --- a/.github/workflows/polkadot.yml +++ b/.github/workflows/polkadot.yml @@ -43,36 +43,35 @@ jobs: echo "image-name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" >> "$GITHUB_OUTPUT" echo "NODE_GIT_REF=$(cat release-version.txt | tr -d '\n')" >> "$GITHUB_ENV" - name: Check Docker image - id: image_check run: | if docker manifest inspect "${FULL_IMAGE_NAME}" > /dev/null 2>&1; then echo "Image ${FULL_IMAGE_NAME} exists in the registry." - echo "::set-output name=continue::false" + echo "CONTINUE_IMAGE_BUILD=false" >> "$GITHUB_ENV" else echo "Image ${FULL_IMAGE_NAME} does not exist in the registry." - echo "::set-output name=continue::true" + echo "CONTINUE_IMAGE_BUILD=true" >> "$GITHUB_ENV" fi - name: Set up QEMU - if: steps.image_check.outputs.continue == 'true' + if: env.CONTINUE_IMAGE_BUILD == 'true' uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - if: steps.image_check.outputs.continue == 'true' + if: env.CONTINUE_IMAGE_BUILD == 'true' uses: docker/setup-buildx-action@v3 - name: Log in to Container registry - if: steps.image_check.outputs.continue == 'true' + if: env.CONTINUE_IMAGE_BUILD == 'true' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker - if: steps.image_check.outputs.continue == 'true' + if: env.CONTINUE_IMAGE_BUILD == 'true' id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and push Docker image - if: steps.image_check.outputs.continue == 'true' + if: env.CONTINUE_IMAGE_BUILD == 'true' uses: docker/build-push-action@v5 with: context: dockerfiles @@ -86,10 +85,10 @@ jobs: CLANG_VERSION=${{ matrix.clang-versions }} tags: ${{ env.FULL_IMAGE_NAME }},image-to-test:latest - name: Switch to default Docker builder - if: steps.image_check.outputs.continue == 'true' + if: env.CONTINUE_IMAGE_BUILD == 'true' run: docker buildx use default - name: Build node to test Docker image - if: steps.image_check.outputs.continue == 'true' + if: env.CONTINUE_IMAGE_BUILD == 'true' uses: docker/build-push-action@v5 with: context: dockerfiles @@ -101,7 +100,7 @@ jobs: GIT_REF=${{ env.NODE_GIT_REF }} tags: test-build-image - name: Push Docker image - if: ${{ steps.image_check.outputs.continue == 'true' && github.ref == env.RELEASE_REF }} + if: ${{ env.CONTINUE_IMAGE_BUILD == 'true' && github.ref == env.RELEASE_REF }} run: docker push ${{ env.FULL_IMAGE_NAME }} build-binaries: runs-on: ubuntu-latest