Skip to content

Commit

Permalink
chore(ci): fix precache main and pre-alfa
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Korolev <[email protected]>
  • Loading branch information
universal-itengineer committed Jun 19, 2024
1 parent a8451b6 commit e8bf3b8
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/ dev_build_precache.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
name: Build main, pre-alpha every 8 hours for dev

env:
MODULES_REGISTRY: ${{ vars.DEV_REGISTRY }}
CI_COMMIT_REF_NAME: ${{ github.ref_name }}
MODULES_MODULE_NAME: ${{ vars.MODULE_NAME }}
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:
Expand All @@ -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

0 comments on commit e8bf3b8

Please sign in to comment.