diff --git a/.github/workflows/release-pullrequest.yaml b/.github/workflows/release-pullrequest.yaml new file mode 100644 index 0000000..9ba559f --- /dev/null +++ b/.github/workflows/release-pullrequest.yaml @@ -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 \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release-tag.yaml similarity index 96% rename from .github/workflows/release.yaml rename to .github/workflows/release-tag.yaml index 00d9041..01d5868 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release-tag.yaml @@ -1,4 +1,4 @@ -name: release +name: release-tag on: push: @@ -106,6 +106,9 @@ jobs: merge: runs-on: buildjet-2vcpu-ubuntu-2204 + permissions: + packages: write + contents: read needs: - package-amd64 - package-arm64 @@ -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 }} \ No newline at end of file diff --git a/config-sample.yaml b/config-sample.yaml index 44c1a8f..a94231d 100644 --- a/config-sample.yaml +++ b/config-sample.yaml @@ -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 are taken from additionalVariables: http:// -> http://sample requireAuthentication: #true/false authenticationMethod: #one of: bearer-token