mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
store pr builds on docker.io
This commit is contained in:
parent
cfea662b03
commit
1de35b1511
3 changed files with 39 additions and 10 deletions
34
.github/workflows/build-and-test.yml
vendored
34
.github/workflows/build-and-test.yml
vendored
|
|
@ -39,8 +39,9 @@ jobs:
|
|||
fetch-depth: 0
|
||||
fetch-tags: 'true'
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
- name: Docker meta for GHCR
|
||||
if: github.event_name != 'pull_request'
|
||||
id: meta_ghcr
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
|
|
@ -51,15 +52,29 @@ jobs:
|
|||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
|
||||
- name: Docker meta for Docker Hub
|
||||
if: github.event_name == 'pull_request'
|
||||
id: meta_docker
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
docker.io/${{ github.repository }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
|
||||
- name: Buildah Build
|
||||
id: build-image
|
||||
uses: redhat-actions/buildah-build@v2
|
||||
with:
|
||||
containerfiles: Containerfile
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
tags: ${{ steps.meta_ghcr.outputs.tags || steps.meta_docker.outputs.tags }}
|
||||
labels: ${{ steps.meta_ghcr.outputs.labels || steps.meta_docker.outputs.labels }}
|
||||
|
||||
- name: Push image
|
||||
- name: Push image to GHCR
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: redhat-actions/push-to-registry@v2
|
||||
with:
|
||||
image: ${{ steps.build-image.outputs.image }}
|
||||
|
|
@ -67,6 +82,15 @@ jobs:
|
|||
username: ${{ github.actor }}
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Push image to Docker
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: redhat-actions/push-to-registry@v2
|
||||
with:
|
||||
image: ${{ steps.build-image.outputs.image }}
|
||||
tags: ${{ steps.build-image.outputs.tags }}
|
||||
username: ${{ secrets.DOCKER_LOGIN }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
build-and-push-iso:
|
||||
name: Build ISO
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue