Skip to content

Commit

Permalink
ci: build test container images for PRs
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Asseman <alexis@semiotic.ai>
  • Loading branch information
aasseman committed Nov 5, 2023
1 parent d2054e8 commit efc65f1
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/pr_container_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
pull_request:
branches:
- master

name: pr-container-build

jobs:
container_build:
runs-on: ubuntu-latest
permissions:
packages: write

steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0

- name: git describe
id: git-describe
run: echo ::set-output name=git-describe::$(git describe --tags --always)

- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: autoagora-processor
tags: >
pr-${{ github.event.number }}-${{ github.sha }}
${{ steps.git-describe.outputs.git-describe }}
containerfiles: |
./Dockerfile
- name: Push
id: push-to-ghcr
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-ghcr.outputs.registry-paths }}"

0 comments on commit efc65f1

Please sign in to comment.