mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 02:47:56 +01:00
generate different tag for pr
This commit is contained in:
parent
c1c16f6420
commit
3b58e69ec4
1 changed files with 13 additions and 3 deletions
16
.github/workflows/build_container.yml
vendored
16
.github/workflows/build_container.yml
vendored
|
|
@ -61,25 +61,35 @@ jobs:
|
||||||
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
|
if: ! inputs.pr
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
ghcr.io/${{ github.repository }}
|
ghcr.io/${{ github.repository }}
|
||||||
context: git
|
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
|
||||||
|
- name: Docker meta for PR
|
||||||
|
if: inputs.pr
|
||||||
|
id: meta_pr
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
ghcr.io/${{ github.repository }}
|
||||||
|
tags: |
|
||||||
|
pr-${{ inputs.pr }}
|
||||||
|
|
||||||
- name: Buildah Build
|
- name: Buildah Build
|
||||||
id: build-image
|
id: build-image
|
||||||
uses: redhat-actions/buildah-build@v2
|
uses: redhat-actions/buildah-build@v2
|
||||||
with:
|
with:
|
||||||
containerfiles: Containerfile
|
containerfiles: Containerfile
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags || steps.meta_pr.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels || steps.meta_pr.outputs.labels }}
|
||||||
|
|
||||||
- name: Push image
|
- name: Push image
|
||||||
uses: redhat-actions/push-to-registry@v2
|
uses: redhat-actions/push-to-registry@v2
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue