Skip to content

feat: Use custom container for package builds #3

feat: Use custom container for package builds

feat: Use custom container for package builds #3

name: Create build container
on:
push:
paths:
- Containerfile
jobs:
build-container:
name: Build container image
runs-on: ubuntu-latest
env:
IMAGE_NAME: fedora-kernel-build
REGISTRY: ghcr.io
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build container image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: latest ${{ github.sha }} 38
containerfiles: |
./Containerfile
- name: Log in to ghcr.io
if: github.ref == 'refs/heads/main'
uses: redhat-actions/podman-login@v1
with:
registry: ${{ env.REGISTRY }}
username: t2linux
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to ghcr.io
if: github.ref == 'refs/heads/main'
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: ${{ env.REGISTRY }}