diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1f75737..16c35b8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,6 +8,9 @@ on: type: string required: false default: latest + force_build: + type: boolean + default: false jobs: @@ -37,9 +40,15 @@ jobs: uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.LIB_SSH_KEY }} - - name: Build image + - name: Build Docker image run: | + if [ "$NO_CACHE" == "true" ]; then + docker build -t cr.yandex/$CR_REGISTRY/$CR_REPO:${IMAGE_TAG::7} --no-cache --ssh default . + else docker build -t cr.yandex/$CR_REGISTRY/$CR_REPO:${IMAGE_TAG::7} --ssh default . + fi + env: + NO_CACHE: ${{ inputs.force_build || 'false' }} - name: Yandex Cloud Login uses: yc-actions/yc-cr-login@v2 with: @@ -59,4 +68,4 @@ jobs: - \ No newline at end of file + ${{ if 1 }}: value: a ${{ else }}: value: b \ No newline at end of file