diff --git a/.github/workflows/build_dev.yml b/.github/workflows/build_dev.yml index 5a690d9..a249414 100644 --- a/.github/workflows/build_dev.yml +++ b/.github/workflows/build_dev.yml @@ -16,7 +16,7 @@ on: jobs: dev_setup_build: - runs-on: ubuntu-latest + runs-on: [self-hosted, regular, selectel] name: Build and Push images steps: - name: Set vars for PR diff --git a/.github/workflows/build_prod.yml b/.github/workflows/build_prod.yml index 827c38a..2a0981b 100644 --- a/.github/workflows/build_prod.yml +++ b/.github/workflows/build_prod.yml @@ -16,7 +16,7 @@ on: jobs: prod_ce_setup_build: - runs-on: ubuntu-latest + runs-on: [self-hosted, regular, selectel] name: Build and Push CE steps: - name: SET VAR @@ -35,7 +35,7 @@ jobs: - uses: deckhouse/modules-actions/build@v1 prod_ee_setup_build: - runs-on: ubuntu-latest + runs-on: [self-hosted, regular, selectel] name: Build and Push EE steps: - name: SET VAR @@ -54,7 +54,7 @@ jobs: - uses: deckhouse/modules-actions/build@v1 prod_fe_setup_build: - runs-on: ubuntu-latest + runs-on: [self-hosted, regular, selectel] name: Build and Push FE steps: - name: SET VAR diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 3342755..7cc0314 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -7,7 +7,7 @@ on: jobs: release-label: name: Release note label - runs-on: ubuntu-latest + runs-on: [self-hosted, regular] steps: - name: Check minimum labels diff --git a/.github/workflows/deploy_dev.yml b/.github/workflows/deploy_dev.yml index ba1a5bd..0062169 100644 --- a/.github/workflows/deploy_dev.yml +++ b/.github/workflows/deploy_dev.yml @@ -36,7 +36,7 @@ on: jobs: deploy-dev: - runs-on: ubuntu-latest + runs-on: [self-hosted, regular, selectel] name: Deploy dev steps: - name: PRINT VARS diff --git a/.github/workflows/deploy_prod.yml b/.github/workflows/deploy_prod.yml index 9e9c407..466904c 100644 --- a/.github/workflows/deploy_prod.yml +++ b/.github/workflows/deploy_prod.yml @@ -41,7 +41,7 @@ on: jobs: print-vars: - runs-on: ubuntu-latest + runs-on: [self-hosted, regular, selectel] name: Print vars steps: - name: PRINT VARS @@ -56,7 +56,7 @@ jobs: job-CE: name: Edition CE - runs-on: ubuntu-latest + runs-on: [self-hosted, regular, selectel] if: github.event.inputs.ce == 'true' steps: - run: echo "CE" @@ -72,7 +72,7 @@ jobs: job-EE: name: Edition EE - runs-on: ubuntu-latest + runs-on: [self-hosted, regular, selectel] if: github.event.inputs.ee == 'true' steps: - run: echo "EE" @@ -88,7 +88,7 @@ jobs: job-FE: name: Edition FE - runs-on: ubuntu-latest + runs-on: [self-hosted, regular, selectel] if: github.event.inputs.fe == 'true' steps: - run: echo "FE" diff --git a/.github/workflows/dev_registry-cleanup.yml b/.github/workflows/dev_registry-cleanup.yml new file mode 100644 index 0000000..3176b36 --- /dev/null +++ b/.github/workflows/dev_registry-cleanup.yml @@ -0,0 +1,47 @@ +# Copyright 2024 Flant JSC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Cleanup dev registries + +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 }} + WERF_DRY_RUN: "false" + +on: + workflow_dispatch: + schedule: + - cron: "12 0 * * 6" + +defaults: + run: + shell: bash + +jobs: + lint: + runs-on: [self-hosted, regular, selectel] + name: Run cleanup + steps: + - uses: actions/checkout@v4 + - uses: deckhouse/modules-actions/setup@v1 + + - name: Cleanup + run: | + werf cleanup \ + --repo ${MODULES_MODULE_SOURCE}/${MODULES_MODULE_NAME} \ + --without-kube=true --config werf_cleanup.yaml diff --git a/werf_cleanup.yaml b/werf_cleanup.yaml new file mode 100644 index 0000000..0fee345 --- /dev/null +++ b/werf_cleanup.yaml @@ -0,0 +1,12 @@ +project: sds-elastic +configVersion: 1 +cleanup: + keepPolicies: + - references: + branch: /.*/ + limit: + in: 168h # keep dev images build during last week which not main|pre-alpha + - references: + branch: /main|pre-alpha/ + imagesPerReference: + last: 5 # keep 5 images for branches main|pre-alpha