Skip to content

Commit

Permalink
copy commits (#9)
Browse files Browse the repository at this point in the history
Co-authored-by: alty1224 <[email protected]>
  • Loading branch information
alnur05 and alty1224 authored Jan 21, 2025
1 parent 8004ca8 commit 13364c1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
with:
component-name: ${{ matrix.component.name }}
component-tag: ${{ env.TAG_NAME }}
access-token: ${{ secrets.GH_ACCESS_TOKEN }}
access-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/delete-package-versions@v5
with:
package-name: ${{ matrix.component.name }}
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ 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:
Expand All @@ -32,13 +41,16 @@ 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 }}
access-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ env.PUSH }}
- name: Build and push
uses: docker/build-push-action@v5
with:
Expand All @@ -47,7 +59,7 @@ jobs:
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 }}
Expand Down

0 comments on commit 13364c1

Please sign in to comment.