Skip to content

Commit

Permalink
chore(ci): update build and deploy prod for login to prod and dev repos
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Korolev <[email protected]>
  • Loading branch information
universal-itengineer committed Dec 18, 2024
1 parent 3c830ac commit 7496c66
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 27 deletions.
87 changes: 77 additions & 10 deletions .github/workflows/release_module_build-and-registration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ env:
MODULES_REGISTRY_LOGIN: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
MODULES_REGISTRY_PASSWORD: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
MODULES_MODULE_TAG: ${{ github.ref_name }}
SOURCE_REPO: "${{secrets.SOURCE_REPO}}"
WERF_SECONDARY_REPO_1: ${{vars.DEV_MODULE_SOURCE}}/${{vars.MODULE_NAME}}
SOURCE_REPO: "${{ secrets.SOURCE_REPO }}"

on:
push:
Expand Down Expand Up @@ -62,8 +61,25 @@ jobs:
- name: Remove unwanted software
uses: ./.github/actions/remove-unwanted-software

- uses: deckhouse/modules-actions/setup@v1
- uses: deckhouse/modules-actions/build@v1
- name: Login to PROD_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.PROD_REGISTRY }}
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
- name: Login to DEV_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}

- uses: deckhouse/modules-actions/[email protected]
with:
module_source: "$MODULES_MODULE_SOURCE"
module_name: ${{ vars.MODULE_NAME }}
module_tag: ${{ github.ref_name }}
secondary_repo: "${{ vars.DEV_MODULE_SOURCE }}/${{ vars.MODULE_NAME }}"

prod_ee_setup_build:
runs-on: ubuntu-latest
Expand All @@ -88,8 +104,25 @@ jobs:
- name: Remove unwanted software
uses: ./.github/actions/remove-unwanted-software

- uses: deckhouse/modules-actions/setup@v1
- uses: deckhouse/modules-actions/build@v1
- name: Login to PROD_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.PROD_REGISTRY }}
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
- name: Login to DEV_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}

- uses: deckhouse/modules-actions/[email protected]
with:
module_source: "$MODULES_MODULE_SOURCE"
module_name: ${{ vars.MODULE_NAME }}
module_tag: ${{ github.ref_name }}
secondary_repo: "${{ vars.DEV_MODULE_SOURCE }}/${{ vars.MODULE_NAME }}"

prod_se_plus_setup_build:
runs-on: ubuntu-latest
Expand All @@ -115,8 +148,25 @@ jobs:
- name: Remove unwanted software
uses: ./.github/actions/remove-unwanted-software

- uses: deckhouse/modules-actions/setup@v1
- uses: deckhouse/modules-actions/build@v1
- name: Login to PROD_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.PROD_REGISTRY }}
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
- name: Login to DEV_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}

- uses: deckhouse/modules-actions/[email protected]
with:
module_source: "$MODULES_MODULE_SOURCE"
module_name: ${{ vars.MODULE_NAME }}
module_tag: ${{ github.ref_name }}
secondary_repo: "${{ vars.DEV_MODULE_SOURCE }}/${{ vars.MODULE_NAME }}"

prod_fe_setup_build:
runs-on: ubuntu-latest
Expand All @@ -142,5 +192,22 @@ jobs:
- name: Remove unwanted software
uses: ./.github/actions/remove-unwanted-software

- uses: deckhouse/modules-actions/setup@v1
- uses: deckhouse/modules-actions/build@v1
- name: Login to PROD_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.PROD_REGISTRY }}
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
- name: Login to DEV_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}

- uses: deckhouse/modules-actions/[email protected]
with:
module_source: "$MODULES_MODULE_SOURCE"
module_name: ${{ vars.MODULE_NAME }}
module_tag: ${{ github.ref_name }}
secondary_repo: "${{ vars.DEV_MODULE_SOURCE }}/${{ vars.MODULE_NAME }}"
90 changes: 73 additions & 17 deletions .github/workflows/release_module_release-channels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ env:
MODULES_REGISTRY_PASSWORD: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
MODULES_MODULE_TAG: ${{ github.event.inputs.tag }}
SOURCE_REPO: "${{secrets.SOURCE_REPO}}"
WERF_SECONDARY_REPO_1: ${{vars.DEV_MODULE_SOURCE}}/${{vars.MODULE_NAME}}

on:
workflow_dispatch:
Expand Down Expand Up @@ -93,10 +92,26 @@ jobs:
if: ${{ github.event.inputs.enableBuild == 'true' }}
uses: ./.github/actions/remove-unwanted-software

- uses: deckhouse/modules-actions/setup@v1
- name: Login to PROD_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.PROD_REGISTRY }}
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
- name: Login to DEV_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}

- if: ${{ github.event.inputs.enableBuild == 'true' }}
uses: deckhouse/modules-actions/build@v1
uses: deckhouse/modules-actions/[email protected]
with:
module_source: "$MODULES_MODULE_SOURCE"
module_name: ${{ vars.MODULE_NAME }}
module_tag: ${{ github.ref_name }}
secondary_repo: "${{ vars.DEV_MODULE_SOURCE }}/${{ vars.MODULE_NAME }}"

- uses: deckhouse/modules-actions/deploy@v1

Expand All @@ -123,17 +138,26 @@ jobs:

- uses: deckhouse/modules-actions/setup@v1

- name: Login to PROD_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.PROD_REGISTRY }}
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
- name: Login to DEV_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}

- if: ${{ github.event.inputs.enableBuild == 'true' }}
uses: deckhouse/modules-actions/build@v1
- name: Register the module if enableBuild
if: ${{ github.event.inputs.enableBuild == 'true' }}
run: |
echo "✨ Register the module ${MODULES_MODULE_NAME}"
crane append \
--oci-empty-base \
--new_layer "" \
--new_tag "${MODULES_MODULE_SOURCE}:${MODULES_MODULE_NAME}"
shell: bash
uses: deckhouse/modules-actions/[email protected]
with:
module_source: "$MODULES_MODULE_SOURCE"
module_name: ${{ vars.MODULE_NAME }}
module_tag: ${{ github.ref_name }}
secondary_repo: "${{ vars.DEV_MODULE_SOURCE }}/${{ vars.MODULE_NAME }}"

- uses: deckhouse/modules-actions/deploy@v1

Expand All @@ -158,10 +182,26 @@ jobs:
if: ${{ github.event.inputs.enableBuild == 'true' }}
uses: ./.github/actions/remove-unwanted-software

- uses: deckhouse/modules-actions/setup@v1
- name: Login to PROD_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.PROD_REGISTRY }}
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
- name: Login to DEV_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}

- if: ${{ github.event.inputs.enableBuild == 'true' }}
uses: deckhouse/modules-actions/build@v1
uses: deckhouse/modules-actions/[email protected]
with:
module_source: "$MODULES_MODULE_SOURCE"
module_name: ${{ vars.MODULE_NAME }}
module_tag: ${{ github.ref_name }}
secondary_repo: "${{ vars.DEV_MODULE_SOURCE }}/${{ vars.MODULE_NAME }}"

- uses: deckhouse/modules-actions/deploy@v1

Expand Down Expand Up @@ -190,9 +230,25 @@ jobs:
if: ${{ github.event.inputs.enableBuild == 'true' }}
uses: ./.github/actions/remove-unwanted-software

- uses: deckhouse/modules-actions/setup@v1
- name: Login to PROD_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.PROD_REGISTRY }}
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
- name: Login to DEV_REGISTRY
uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}

- if: ${{ github.event.inputs.enableBuild == 'true' }}
uses: deckhouse/modules-actions/build@v1
uses: deckhouse/modules-actions/[email protected]
with:
module_source: "$MODULES_MODULE_SOURCE"
module_name: ${{ vars.MODULE_NAME }}
module_tag: ${{ github.ref_name }}
secondary_repo: "${{ vars.DEV_MODULE_SOURCE }}/${{ vars.MODULE_NAME }}"

- uses: deckhouse/modules-actions/deploy@v1

0 comments on commit 7496c66

Please sign in to comment.