Skip to content

Commit

Permalink
Applied changes from commit 2db4ff9390f019c346cef4af0f2a3e6eaf4d7735
Browse files Browse the repository at this point in the history
  • Loading branch information
alty1224 committed Jan 20, 2025
1 parent 8004ca8 commit c405dfa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
fail-fast: false
matrix:
component:
- name: qubership-opensearch-dbaas-adapter
- name: qubership-backup-daemon
base: alpine
if: github.event.ref_type == 'branch'
runs-on: ubuntu-latest
steps:
Expand All @@ -27,8 +28,8 @@ jobs:
uses: Netcracker/[email protected]
with:
component-name: ${{ matrix.component.name }}
component-tag: ${{ env.TAG_NAME }}
access-token: ${{ secrets.GH_ACCESS_TOKEN }}
component-tag: ${{ env.TAG_NAME }}_${{ matrix.component.base }}
access-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/delete-package-versions@v5
with:
package-name: ${{ matrix.component.name }}
Expand Down
27 changes: 19 additions & 8 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,27 @@ on:
push:
branches:
- '**'
workflow_dispatch:
inputs:
publish_docker:
description: "Publish image to ghcr.io"
type: boolean
default: true
required: false
env:
TAG_NAME: ${{ github.event.release.tag_name || github.ref }}
PUSH: ${{ (github.event_name == 'workflow_dispatch' && inputs.publish_docker) || !startsWith(github.ref, 'refs/heads/dependabot') }}
GITHUB_GROUP: ${{ github.repository_owner }}

jobs:
multiplatform_build:
strategy:
fail-fast: false
matrix:
component:
- name: qubership-opensearch-dbaas-adapter
file: docker/Dockerfile
- name: qubership-backup-daemon
file: alpine/Dockerfile
base: alpine
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -32,25 +42,26 @@ jobs:
password: ${{secrets.GITHUB_TOKEN}}
- name: Prepare Tag
run: echo "TAG_NAME=$(echo ${TAG_NAME} | sed 's@refs/tags/@@;s@refs/heads/@@;s@/@_@g')" >> $GITHUB_ENV
- name: Prepare Group
run: echo "GITHUB_GROUP=${GITHUB_GROUP,,}" >> $GITHUB_ENV
- name: Get package IDs for delete
id: get-ids-for-delete
uses: Netcracker/[email protected]
with:
component-name: ${{ matrix.component.name }}
component-tag: ${{ env.TAG_NAME }}
access-token: ${{ secrets.GH_ACCESS_TOKEN }}
component-tag: ${{ env.TAG_NAME }}_${{ matrix.component.base }}
access-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ env.PUSH }}
- name: Build and push
uses: docker/build-push-action@v5
with:
no-cache: true
context: ${{ matrix.component.context }}
context: ${{ matrix.component.dir }}
file: ${{ matrix.component.file }}
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/netcracker/${{ matrix.component.name }}:${{ env.TAG_NAME }}
tags: ghcr.io/${{ env.GITHUB_GROUP }}/${{ matrix.component.name }}:${{ env.TAG_NAME }}_${{ matrix.component.base }}
provenance: false
build-args: |
GH_ACCESS_TOKEN=${{ secrets.GH_ACCESS_TOKEN }}
- uses: actions/delete-package-versions@v5
with:
package-name: ${{ matrix.component.name }}
Expand Down

0 comments on commit c405dfa

Please sign in to comment.