diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index 9e6d73a6..fe594328 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -15,6 +15,7 @@ env: jobs: build: name: Build + if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest strategy: fail-fast: false @@ -72,6 +73,7 @@ jobs: retention-days: 1 merge: runs-on: ubuntu-latest + if: github.event.pull_request.head.repo.full_name == github.repository needs: - build steps: @@ -111,4 +113,19 @@ jobs: docker buildx imagetools inspect ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/limitador:${{ steps.meta.outputs.version }} - name: Smoke Test run: | - docker run --rm -t ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/limitador:${{ steps.meta.outputs.version }} limitador-server --help \ No newline at end of file + docker run --rm -t ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/limitador:${{ steps.meta.outputs.version }} limitador-server --help + build-from-forks: + name: Build + if: github.event.pull_request.head.repo.full_name != github.repository + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Build Image + id: build-image + uses: redhat-actions/buildah-build@v2 + with: + image: limitador + tags: ${{ github.sha }} + dockerfiles: | + ./Dockerfile