From e8bf3b8d60c27d4d9ea0f1404d152b977081a1b3 Mon Sep 17 00:00:00 2001 From: Nikita Korolev Date: Wed, 19 Jun 2024 17:02:37 +0300 Subject: [PATCH 1/2] chore(ci): fix precache main and pre-alfa Signed-off-by: Nikita Korolev --- .github/workflows/ dev_build_precache.yml | 25 +++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ dev_build_precache.yml b/.github/workflows/ dev_build_precache.yml index a57bcc556..0cbcd8b3c 100644 --- a/.github/workflows/ dev_build_precache.yml +++ b/.github/workflows/ dev_build_precache.yml @@ -1,5 +1,4 @@ name: Build main, pre-alpha every 8 hours for dev - env: MODULES_REGISTRY: ${{ vars.DEV_REGISTRY }} CI_COMMIT_REF_NAME: ${{ github.ref_name }} @@ -7,24 +6,31 @@ env: MODULES_MODULE_SOURCE: ${{ vars.DEV_MODULE_SOURCE }} MODULES_REGISTRY_LOGIN: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }} MODULES_REGISTRY_PASSWORD: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }} - on: workflow_dispatch: schedule: - cron: "0 */8 * * *" - defaults: run: shell: bash - jobs: build_branches: name: Build main runs-on: ubuntu-latest strategy: matrix: - branch: [main, pre-alpha] + branch: [main, pre-alpha, chore/ci/fix-build] steps: + - name: Set vars + id: modules_module_tag + run: | + if [[ "${{ github.ref_name }}" == 'pre-alpha' || "${{ github.ref_name }}" == 'main' ]]; then + MODULES_MODULE_TAG="${{ github.ref_name }}" + else + MODULES_MODULE_TAG="$(echo pr${{ github.event.pull_request.number }})" + fi + echo "MODULES_MODULE_TAG=$MODULES_MODULE_TAG" >> "$GITHUB_ENV" + - name: Checkout repository uses: actions/checkout@v4 with: @@ -35,11 +41,4 @@ jobs: - uses: deckhouse/modules-actions/setup@v1 - - name: Build images - run: | - # MODULES_MODULE_TAG env is required by release-channel image. - # This image is not significant for development environments, so we use fake value for it. - echo "Warmup cache using MODULES_MODULE_TAG=dev" - export MODULES_MODULE_TAG=dev - source "$(werf ci-env github --as-file)" - werf build --repo=${MODULES_MODULE_SOURCE}/${MODULES_MODULE_NAME} + - uses: deckhouse/modules-actions/build@v1 From 8f65b7715236391920e64c76a4d3d2f6566999b6 Mon Sep 17 00:00:00 2001 From: Nikita Korolev <141920865+universal-itengineer@users.noreply.github.com> Date: Wed, 19 Jun 2024 19:53:07 +0300 Subject: [PATCH 2/2] Update .github/workflows/ dev_build_precache.yml Co-authored-by: Ivan Mikheykin Signed-off-by: Nikita Korolev <141920865+universal-itengineer@users.noreply.github.com> --- .github/workflows/ dev_build_precache.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ dev_build_precache.yml b/.github/workflows/ dev_build_precache.yml index 0cbcd8b3c..d0778f6b4 100644 --- a/.github/workflows/ dev_build_precache.yml +++ b/.github/workflows/ dev_build_precache.yml @@ -27,7 +27,7 @@ jobs: if [[ "${{ github.ref_name }}" == 'pre-alpha' || "${{ github.ref_name }}" == 'main' ]]; then MODULES_MODULE_TAG="${{ github.ref_name }}" else - MODULES_MODULE_TAG="$(echo pr${{ github.event.pull_request.number }})" + MODULES_MODULE_TAG="pr${{ github.event.pull_request.number }}" fi echo "MODULES_MODULE_TAG=$MODULES_MODULE_TAG" >> "$GITHUB_ENV"