From 3ee500b54605bff01962c7d8d5f100ae7d762502 Mon Sep 17 00:00:00 2001 From: Adrian Riobo Lorenzo Date: Thu, 1 Aug 2024 08:29:23 +0200 Subject: [PATCH] test Signed-off-by: Adrian Riobo Lorenzo --- .github/workflows/build-and-push-image.yml | 48 +++++++++++++++++++ .../{build-oci.yaml => oci-builder.yaml} | 4 +- .github/workflows/oci-pusher.yml | 29 +++++++++++ 3 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-and-push-image.yml rename .github/workflows/{build-oci.yaml => oci-builder.yaml} (97%) create mode 100644 .github/workflows/oci-pusher.yml diff --git a/.github/workflows/build-and-push-image.yml b/.github/workflows/build-and-push-image.yml new file mode 100644 index 0000000..acb3217 --- /dev/null +++ b/.github/workflows/build-and-push-image.yml @@ -0,0 +1,48 @@ +name: build-and-push-image + +on: + + push: + branches: + - main + + pull_request: + branches: + - main + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Login to GitHub Container Registry + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image (post merge) + uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 + with: + context: . + file: ./oci/Containerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/build-oci.yaml b/.github/workflows/oci-builder.yaml similarity index 97% rename from .github/workflows/build-oci.yaml rename to .github/workflows/oci-builder.yaml index 356a822..603acc1 100644 --- a/.github/workflows/build-oci.yaml +++ b/.github/workflows/oci-builder.yaml @@ -1,4 +1,4 @@ -name: oci-builds +name: oci-builder on: push: @@ -62,7 +62,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: crc-builder - path: path/*.tar + path: "*.tar" \ No newline at end of file diff --git a/.github/workflows/oci-pusher.yml b/.github/workflows/oci-pusher.yml new file mode 100644 index 0000000..4fa8c48 --- /dev/null +++ b/.github/workflows/oci-pusher.yml @@ -0,0 +1,29 @@ +name: oci-pusher + +on: + workflow_run: + workflows: oci-builder + types: + - completed + +jobs: + windows-e2e-ocp: + uses: crc-org/crc/.github/workflows/windows-qe-tpl.yml@main + strategy: + fail-fast: false + matrix: + qe-type: ['e2e','integration'] + preset: ['openshift', 'microshift', 'all'] + exclude: + - qe-type: 'e2e' + preset: 'all' + - qe-type: 'integration' + preset: 'openshift' + - qe-type: 'integration' + preset: 'microshift' + with: + trigger-workflow-run-id: ${{ github.event.workflow_run.id }} + qe-type: ${{matrix.qe-type}} + preset: ${{matrix.preset}} + secrets: inherit +