-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Applied changes from commit 2db4ff9390f019c346cef4af0f2a3e6eaf4d7735
- Loading branch information
alty1224
committed
Jan 20, 2025
1 parent
8004ca8
commit c405dfa
Showing
2 changed files
with
23 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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 }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 }} | ||
|