From efc65f10f5f628c9b0b15ccb34a81840aeb941b4 Mon Sep 17 00:00:00 2001 From: Alexis Asseman Date: Sat, 4 Nov 2023 19:23:06 -0700 Subject: [PATCH] ci: build test container images for PRs Signed-off-by: Alexis Asseman --- .github/workflows/pr_container_build.yml | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/pr_container_build.yml diff --git a/.github/workflows/pr_container_build.yml b/.github/workflows/pr_container_build.yml new file mode 100644 index 0000000..75feae3 --- /dev/null +++ b/.github/workflows/pr_container_build.yml @@ -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 }}"