Skip to content

Commit

Permalink
feat: merge pull request #28 from krateoplatformops/27-update-github-…
Browse files Browse the repository at this point in the history
…pipeline

27 update GitHub pipeline
  • Loading branch information
FrancescoL96 authored Jul 10, 2024
2 parents 6e9e238 + 0e33f4f commit f25db58
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 3 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/release-pullrequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: release-pullrequest

on:
pull_request:
branches:
- main

env:
REGISTRY: ghcr.io

jobs:
package-amd64:
runs-on: buildjet-2vcpu-ubuntu-2204
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to CR
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build docker image and push
id: docker_build_amd64
uses: docker/build-push-action@v4
with:
push: false
platforms: linux/amd64
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY }}/${{ github.repository }},push-by-digest=true,name-canonical=true,push=true

package-arm64:
runs-on: buildjet-2vcpu-ubuntu-2204-arm
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to CR
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build docker image and push
id: docker_build_arm64
uses: docker/build-push-action@v4
with:
push: false
platforms: linux/arm64
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY }}/${{ github.repository }},push-by-digest=true,name-canonical=true,push=true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: release
name: release-tag

on:
push:
Expand Down Expand Up @@ -106,6 +106,9 @@ jobs:

merge:
runs-on: buildjet-2vcpu-ubuntu-2204
permissions:
packages: write
contents: read
needs:
- package-amd64
- package-arm64
Expand Down Expand Up @@ -140,4 +143,4 @@ jobs:
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.meta.outputs.version }}
4 changes: 3 additions & 1 deletion config-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ metadata:
name: # ExporterScraperConfig name
spec:
exporterConfig: # same as krateoplatformops/finops-prometheus-exporter-generic
name: #name of the exporter
provider:
name: # name of the provider config
namespace: # namespace of the provider config
url: #url including http/https of the CSV-based API to export, parts with <varName> are taken from additionalVariables: http://<varName> -> http://sample
requireAuthentication: #true/false
authenticationMethod: #one of: bearer-token
Expand Down

0 comments on commit f25db58

Please sign in to comment.