Add tags for Konflux-built image #51
Workflow file for this run
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: ResultsDB_Frontend | |
| "on": | |
| pull_request: | |
| push: | |
| workflow_dispatch: | |
| inputs: {} | |
| jobs: | |
| hadolint: | |
| name: Hadolint | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| dockerfile: | |
| - Dockerfile | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: hadolint/hadolint-action@v3.1.0 | |
| with: | |
| dockerfile: ${{ matrix.dockerfile }} | |
| failure-threshold: warning | |
| image-build: | |
| name: Container Image Build | |
| needs: hadolint | |
| runs-on: ubuntu-latest | |
| env: | |
| IMAGE_NAME: resultsdb_frontend | |
| REGISTRY: quay.io/factory2 | |
| GH_REGISTRY: ghcr.io/${{ github.actor }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Image | |
| id: build-image | |
| uses: redhat-actions/buildah-build@v2 | |
| with: | |
| image: ${{ env.IMAGE_NAME }} | |
| tags: >- | |
| ${{ github.ref == 'refs/heads/develop' && 'latest' || '' }} | |
| ${{ github.sha }} | |
| containerfiles: Dockerfile | |
| build-args: | | |
| GITHUB_SHA=${{ github.sha }} | |
| - name: Log in to the image registry | |
| if: github.event_name == 'push' && github.actor != 'dependabot[bot]' | |
| uses: redhat-actions/podman-login@v1 | |
| with: | |
| registry: ${{ secrets.REGISTRY_USER && env.REGISTRY || env.GH_REGISTRY }} | |
| username: ${{ secrets.REGISTRY_USER || github.actor }} | |
| password: ${{ secrets.REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }} | |
| - name: Push Image | |
| if: github.event_name == 'push' && github.actor != 'dependabot[bot]' | |
| uses: redhat-actions/push-to-registry@v2 | |
| with: | |
| image: ${{ steps.build-image.outputs.image }} | |
| tags: ${{ steps.build-image.outputs.tags }} | |
| registry: ${{ secrets.REGISTRY_USER && env.REGISTRY || env.GH_REGISTRY }} |