1
0
Fork 0
mirror of https://github.com/JasonN3/build-container-installer.git synced 2025-12-25 10:57:55 +01:00

use bot for tests

This commit is contained in:
Jason N. 2024-03-16 15:47:14 -04:00
parent 6d0f1066a5
commit a18843e281
2 changed files with 37 additions and 30 deletions

View file

@ -6,7 +6,12 @@ on:
- 'main'
tags:
- 'v*'
pull_request:
workflow_run:
workflows: [Run Tests on PR]
types:
- completed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@ -26,6 +31,10 @@ env:
jobs:
build-container:
if: >
github.event_name == 'push' ||
( github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' )
name: Build Container Image
runs-on: ubuntu-latest
permissions:
@ -39,9 +48,8 @@ jobs:
fetch-depth: 0
fetch-tags: 'true'
- name: Docker meta for GHCR
if: github.event_name != 'pull_request'
id: meta_ghcr
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
@ -52,29 +60,15 @@ 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_ghcr.outputs.tags || steps.meta_docker.outputs.tags }}
labels: ${{ steps.meta_ghcr.outputs.labels || steps.meta_docker.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Push image to GHCR
if: github.event_name != 'pull_request'
- name: Push image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
@ -82,15 +76,6 @@ 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