Răsfoiți Sursa

[CDP/KCM-3744] - Establish Image Building in Merge Queue (#3118)

Signed-off-by: Ishaan Mittal <ishaanmittal123@gmail.com>
Signed-off-by: Christian Petersen <Christian.Petersen2@ibm.com>
Signed-off-by: thomasvn <thomasvn.dev@gmail.com>
Signed-off-by: Nik Willwerth <nwillwerth@kubecost.com>
Signed-off-by: Kaelan Patel <kaelanspatel@gmail.com>
Signed-off-by: Alex Meijer <alexander.meijer@ibm.com>
Signed-off-by: Alex Meijer <ameijer@users.noreply.github.com>
Co-authored-by: Ishaan Mittal <ishaanmittal123@gmail.com>
Co-authored-by: Thomas Nguyen <thomasvn.dev@gmail.com>
Co-authored-by: nik-kc <127428785+nik-kc@users.noreply.github.com>
Co-authored-by: Kaelan Patel <32113845+kaelanspatel@users.noreply.github.com>
Co-authored-by: Alex Meijer <ameijer@users.noreply.github.com>
Christian Petersen 1 an în urmă
părinte
comite
ff82178cf2
2 a modificat fișierele cu 38 adăugiri și 0 ștergeri
  1. 35 0
      .github/workflows/build-test-image.yml
  2. 3 0
      .github/workflows/build-test.yaml

+ 35 - 0
.github/workflows/build-test-image.yml

@@ -0,0 +1,35 @@
+name: Build and Publish Test Image
+
+on:
+  merge_group:
+    types: [checks_requested]
+
+env:
+  REGISTRY: ghcr.io
+
+jobs:
+  build-and-publish-test-image:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      packages: write
+    steps:
+      - name: Checkout Repo
+        uses: actions/checkout@v4
+        with:
+          ref: ${{ github.event.merge_group.head_sha }}
+      - name: Set SHA
+        id: sha
+        run: |
+          echo "OC_SHORTHASH=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
+      - name: Set OpenCost Image Tags
+        id: tags
+        run: |
+          echo "IMAGE_TAG=ghcr.io/${{ github.repository_owner }}/opencost:test-${{ steps.sha.outputs.OC_SHORTHASH }}" >> $GITHUB_OUTPUT
+      - name: Build and publish container
+        uses: ./github/actions/build-container
+        with:
+          actor: ${{ github.actor }}
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          image_tag: ${{ steps.tags.outputs.IMAGE_TAG }}
+          release_version: test-${{ steps.sha.outputs.OC_SHORTHASH }}

+ 3 - 0
.github/workflows/build-test.yaml

@@ -9,6 +9,9 @@ on:
     branches:
     branches:
       - develop
       - develop
 
 
+  merge_group:
+    types: [checks_requested]
+
 jobs:
 jobs:
   validate-protobuf:
   validate-protobuf:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest