|
| 1 | +name: Publish Container Images |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*.*.*' |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + docker: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - |
| 14 | + name: Checkout |
| 15 | + |
| 16 | + |
| 17 | + - name: Prepare Image Metadata |
| 18 | + id: meta |
| 19 | + uses: docker/metadata-action@v3 |
| 20 | + with: |
| 21 | + images: | |
| 22 | + ghcr.io/radiorabe/ubi8-minimal |
| 23 | + tags: | |
| 24 | + type=schedule |
| 25 | + type=ref,event=branch |
| 26 | + type=ref,event=pr |
| 27 | + type=semver,pattern={{version}} |
| 28 | + type=semver,pattern={{major}}.{{minor}} |
| 29 | + type=semver,pattern={{major}} |
| 30 | + type=sha |
| 31 | +
|
| 32 | + - name: Set up QEMU |
| 33 | + uses: docker/setup-qemu-action@v1 |
| 34 | + |
| 35 | + - name: Set up Docker Buildx |
| 36 | + uses: docker/setup-buildx-action@v1 |
| 37 | + |
| 38 | + - name: Login to GitHub Container Registry |
| 39 | + uses: docker/login-action@v1 |
| 40 | + if: github.event_name != 'pull_request' |
| 41 | + with: |
| 42 | + registry: ghcr.io |
| 43 | + username: ${{ github.actor }} |
| 44 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 45 | + |
| 46 | + - name: Build and push |
| 47 | + id: docker_build |
| 48 | + uses: docker/build-push-action@v2 |
| 49 | + with: |
| 50 | + context: . |
| 51 | + file: ./Dockerfile |
| 52 | + platforms: linux/amd64 |
| 53 | + push: ${{ github.event_name != 'pull_request' }} |
| 54 | + tags: ${{ steps.meta.outputs.tags }} |
| 55 | + labels: | |
| 56 | + name="ubi8-minimal" |
| 57 | + version=${{ steps.meta.outputs.version }} |
| 58 | + com.redhat.component="rabe-ubi8-minimal-container" |
| 59 | + io.k8s.display-name="RaBe Universal Base Image 8 Minimal" |
| 60 | + io.openshift.expose-services="" |
| 61 | + io.openshift.tags="minimal rhel8 rabe" |
| 62 | + org.opencontainers.image.title=${{ github.event.repository.name }} |
| 63 | + org.opencontainers.image.description=${{ github.event.repository.description }} |
| 64 | + org.opencontainers.image.url=${{ github.event.repository.html_url }} |
| 65 | + org.opencontainers.image.source=${{ github.event.repository.html_url }} |
| 66 | + org.opencontainers.image.version=${{ steps.meta.outputs.version }} |
| 67 | + org.opencontainers.image.created=${{ steps.meta.outputs.created }} |
| 68 | + org.opencontainers.image.revision=${{ github.sha }} |
| 69 | + org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }} |
0 commit comments