Remove images from local disk once they are pushed to the registry #653
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR build | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| env: | |
| QUAY_REGISTRY: quay.io | |
| RH_REGISTRY: registry.redhat.io | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build_pr: | |
| # Build only when the PR comes from a branch in the same repo or forced | |
| if: github.repository == github.event.pull_request.head.repo.full_name || inputs.force_build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Log in to Quay.io | |
| uses: redhat-actions/podman-login@v1 | |
| with: | |
| username: ${{ secrets.QUAY_USER }} | |
| password: ${{ secrets.QUAY_TOKEN }} | |
| registry: ${{ env.QUAY_REGISTRY }} | |
| - name: Build All | |
| run: | | |
| env | |
| set -x | |
| URL="${{ github.event.pull_request._links.self.href }}" | |
| echo "URL=$URL" | |
| if curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ github.token }}" -H "X-GitHub-Api-Version: 2022-11-28" "$URL"|jq -r .body|grep -qi '^Test-Hints:.*force-build=true'; then | |
| FORCE_BUILD=true | |
| else | |
| FORCE_BUILD=false | |
| fi | |
| echo "sha=${{ github.event.pull_request.head.sha }}" | |
| SHA=$(cut -c1-8 <<< ${{ github.event.pull_request.head.sha }}) | |
| make version | |
| echo "force_build=${{ github.event.inputs.force_build }}" | |
| make all SHA=${SHA} DATE=pr${{ github.event.number }} FORCE_BUILD=$FORCE_BUILD |