diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..2f27b1a --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,32 @@ +name: Build container image +on: + pull_request: + +env: + IMAGE_NAME: ${{ github.event.repository.name }} + IMAGE_TAGS: ${{ github.sha }} + +jobs: + push-quay: + name: Build container image + runs-on: ubuntu-22.04 + + steps: + - name: Checkout Push to Registry action + uses: actions/checkout@v2 + + - name: Install qemu dependency + run: | + sudo apt-get update + sudo apt-get install -y qemu-user-static + + - name: Build Image + id: build_image + uses: redhat-actions/buildah-build@v2 + with: + image: ${{ env.IMAGE_NAME }} + tags: ${{ env.IMAGE_TAGS }} + archs: amd64, arm64 + containerfiles: | + ./Dockerfile + diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..225f67e --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,42 @@ +name: Build container image +on: + release: + +env: + IMAGE_NAME: ${{ github.event.repository.name }} + IMAGE_TAGS: ${{ github.ref_name }} + +jobs: + push-quay: + name: Build container image + runs-on: ubuntu-22.04 + + steps: + - name: Checkout Push to Registry action + uses: actions/checkout@v2 + + - name: Install qemu dependency + run: | + sudo apt-get update + sudo apt-get install -y qemu-user-static + + - name: Build Image + id: build_image + uses: redhat-actions/buildah-build@v2 + with: + image: ${{ env.IMAGE_NAME }} + tags: ${{ env.IMAGE_TAGS }} + archs: amd64, arm64 + containerfiles: | + ./Dockerfile + + - name: Push To Registry + uses: redhat-actions/push-to-registry@v2 + id: push_image + with: + image: ${{ steps.build_image.outputs.image }} + tags: ${{ steps.build_image.outputs.tags }} + registry: ${{ vars.IMAGE_REGISTRY }}/${{ vars.IMAGE_NAMESPACE }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} +