|
1 | | -name: Build and Publish Redhat Distribution Container for Multi-Arch |
| 1 | +name: Build, test, and publish Red Hat Distribution Containers |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | pull_request: |
@@ -38,20 +38,38 @@ jobs: |
38 | 38 | - name: Set up Docker Buildx |
39 | 39 | uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 |
40 | 40 |
|
| 41 | + - name: Build image |
| 42 | + id: build |
| 43 | + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 |
| 44 | + with: |
| 45 | + context: . |
| 46 | + file: distribution/Containerfile |
| 47 | + platforms: ${{ matrix.platform }} |
| 48 | + push: false |
| 49 | + tags: ${{ env.IMAGE_NAME }}:${{ github.sha }} |
| 50 | + load: true # needed to load for smoke test |
| 51 | + |
| 52 | + - name: Smoke image |
| 53 | + id: smoke |
| 54 | + run: | |
| 55 | + docker run --rm ${{ env.IMAGE_NAME }}:${{ github.sha }} |
| 56 | +
|
41 | 57 | - name: Log in to Quay.io |
| 58 | + id: login |
42 | 59 | if: github.event_name == 'push' |
43 | 60 | uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 |
44 | 61 | with: |
45 | 62 | registry: ${{ env.REGISTRY }} |
46 | 63 | username: ${{ secrets.QUAY_USERNAME }} |
47 | 64 | password: ${{ secrets.QUAY_PASSWORD }} |
48 | 65 |
|
49 | | - - name: Build image and push to quay.io only on push event |
50 | | - id: build |
| 66 | + - name: Publish image to Quay.io |
| 67 | + id: publish |
| 68 | + if: github.event_name == 'push' |
51 | 69 | uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 |
52 | 70 | with: |
53 | 71 | context: . |
54 | 72 | file: distribution/Containerfile |
55 | 73 | platforms: ${{ matrix.platform }} |
56 | | - push: ${{ github.event_name == 'push' }} |
| 74 | + push: true |
57 | 75 | tags: ${{ env.IMAGE_NAME }}:${{ github.sha }},${{ env.IMAGE_NAME }}:latest |
0 commit comments