Renovate: Update kube-prometheus-stack Docker tag to v80.14.4 (#458) #545
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
| # Copyright SAP SE | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Build and Push Docker Images | |
| on: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| build-and-push: | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| runs-on: large_runner_16core_64gb | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - 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 Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Only build and push the postgres image if there are changes in the | |
| # postgres directory. | |
| - name: Get all changed postgres/ files | |
| id: changed_postgres_files | |
| uses: tj-actions/changed-files@v47 | |
| with: | |
| files: | | |
| postgres/** | |
| - name: Docker Meta (Cortex Postgres) | |
| if: steps.changed_postgres_files.outputs.all_changed_files != '' | |
| id: meta_cortex_postgres | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ github.repository }}-postgres | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=sha | |
| latest | |
| - name: Build and Push Cortex Postgres | |
| if: steps.changed_postgres_files.outputs.all_changed_files != '' | |
| id: push_cortex_postgres | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: postgres | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta_cortex_postgres.outputs.tags }} | |
| labels: ${{ steps.meta_cortex_postgres.outputs.labels }} | |
| build-args: | | |
| GIT_TAG=${{ github.ref_name }} | |
| GIT_COMMIT=${{ github.sha }} | |
| - name: Generate Artifact Attestation for Cortex Postgres | |
| if: steps.changed_postgres_files.outputs.all_changed_files != '' | |
| uses: actions/attest-build-provenance@v3 | |
| with: | |
| subject-name: ${{ env.REGISTRY }}/${{ github.repository }}-postgres | |
| subject-digest: ${{ steps.push_cortex_postgres.outputs.digest }} | |
| push-to-registry: true | |
| # Build & push new cortex image | |
| - name: Docker Meta (Cortex) | |
| id: meta_cortex | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ github.repository }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=sha | |
| latest | |
| - name: Build and Push Cortex | |
| id: push_cortex | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta_cortex.outputs.tags }} | |
| labels: ${{ steps.meta_cortex.outputs.labels }} | |
| build-args: | | |
| GIT_TAG=${{ github.ref_name }} | |
| GIT_COMMIT=${{ github.sha }} | |
| - name: Generate Artifact Attestation for Cortex | |
| uses: actions/attest-build-provenance@v3 | |
| with: | |
| subject-name: ${{ env.REGISTRY }}/${{ github.repository }} | |
| subject-digest: ${{ steps.push_cortex.outputs.digest }} | |
| push-to-registry: true |