Skip to content

Commit

Permalink
chore(ci): fix main build pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Jun 19, 2024
1 parent 699c197 commit 1e9c972
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/__build-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ jobs:
- uses: actions/checkout@v4

- name: Download artifact with built image
if: ${{ !inputs.push }}
uses: actions/download-artifact@v4
with:
name: image-${{ matrix.os }}-${{ matrix.arch }}
Expand All @@ -265,9 +266,10 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Load image
run: |
docker load --input /tmp/${{ matrix.os }}/${{ matrix.arch }}/image.tar
docker image ls -a
if: ${{ !inputs.push }}
run: docker load --input /tmp/${{ matrix.os }}/${{ matrix.arch }}/image.tar

- run: docker image ls -a

- name: Test the image by running it with -version flag
# NOTE: we can't use steps.build.outputs.tags here because it's there's more than one tag
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
push:
branches:
- 'main'
pull_request:
branches:
- '*'
workflow_dispatch: {}

jobs:
Expand All @@ -26,4 +29,6 @@ jobs:
username: ${{ vars.DOCKERHUB_PUSH_USERNAME }}
registry: docker.io
image-name: ${{ vars.DOCKERHUB_IMAGE_NAME }}
push: true
# If we pushed then it means we want to build and push the image.
# Branch filter above will decide pushes to which branch will trigger this.
push: ${{ github.event.action == 'push' }}
11 changes: 0 additions & 11 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,6 @@ jobs:
- name: Verify that uninstalling operator CRDs via kustomize works
run: make uninstall

build-image:
uses: ./.github/workflows/__build-workflow.yaml
secrets:
dockerhub-token: ${{ secrets.DOCKERHUB_PUSH_TOKEN }}
gh-pat: ${{ secrets.PAT_GITHUB }}
with:
username: ${{ vars.DOCKERHUB_PUSH_USERNAME }}
registry: docker.io
image-name: ${{ vars.DOCKERHUB_IMAGE_NAME }}
push: false

build:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 1e9c972

Please sign in to comment.