Update base image from alpine:3.22 to alpine:3.23 #48
This file contains hidden or 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
| name: Build Artifacts | |
| permissions: | |
| contents: read | |
| packages: write | |
| actions: read | |
| on: | |
| release: | |
| types: [created] | |
| push: | |
| branches: | |
| - '**' | |
| paths-ignore: | |
| - 'docs/**' | |
| - 'CODE-OF-CONDUCT.md' | |
| - 'CONTRIBUTING.md' | |
| - 'LICENSE' | |
| - 'README.md' | |
| - 'SECURITY.md' | |
| pull_request: | |
| branches: | |
| - '**' | |
| paths-ignore: | |
| - 'docs/**' | |
| - 'CODE-OF-CONDUCT.md' | |
| - 'CONTRIBUTING.md' | |
| - 'LICENSE' | |
| - 'README.md' | |
| - 'SECURITY.md' | |
| env: | |
| TAG_NAME: ${{ github.event.release.tag_name || github.ref }} | |
| GITHUB_GROUP: ${{ github.repository_owner }} | |
| concurrency: | |
| # On main/release, we don't want any jobs cancelled so the sha is used to name the group | |
| # On PR branches, we cancel the job if new commits are pushed | |
| # More info: https://stackoverflow.com/a/68422069/253468 | |
| group: ${{ github.ref == 'refs/heads/main' && format('ci-main-{0}', github.sha) || format('ci-main-{0}', github.ref) }} | |
| cancel-in-progress: true | |
| jobs: | |
| multiplatform_build: | |
| if: github.event.pull_request.user.login != 'dependabot[bot]' || github.event_name == 'pull_request' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| component: | |
| - name: qubership-docker-kubectl | |
| file: Dockerfile | |
| context: "" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${GITHUB_ACTOR} | |
| 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: Derive major tag | |
| id: semver | |
| shell: bash | |
| run: | | |
| if [[ "$RAW" =~ ^[0-9]+(\.[0-9]+){0,2}$ ]]; then | |
| MAJOR="${RAW%%.*}" | |
| echo "MAJOR_TAG=$MAJOR" >> "$GITHUB_ENV" | |
| echo "has_major=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "MAJOR_TAG=" >> "$GITHUB_ENV" | |
| echo "has_major=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Compose image tags | |
| shell: bash | |
| run: | | |
| IMAGE="ghcr.io/${GITHUB_GROUP}/${{ matrix.component.name }}" | |
| TAGS="${IMAGE}:${TAG_NAME}" | |
| if [[ -n "${MAJOR_TAG}" ]]; then | |
| TAGS="${TAGS},${IMAGE}:${MAJOR_TAG}" | |
| fi | |
| echo "TAGS=${TAGS}" >> "$GITHUB_ENV" | |
| - name: Get package IDs for delete | |
| id: get-ids-for-delete | |
| uses: Netcracker/get-package-ids@v0.0.1 | |
| with: | |
| component-name: ${{ matrix.component.name }} | |
| component-tag: ${{ env.TAG_NAME }} | |
| access-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| no-cache: true | |
| context: ${{ matrix.component.context }} | |
| file: ${{ matrix.component.file }} | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }} | |
| tags: ${{ env.TAGS }} | |
| provenance: false |