Skip to content

Build

Build #8

Workflow file for this run

name: Build
on:
pull_request:
push:
tags:
- "*"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rhel: [9]
steps:
- name: Define the tag
id: tag
shell: bash
run: |
if [ -n "$GITHUB_HEAD_REF" ]; then
echo tag=${GITHUB_HEAD_REF} | sed -E 's,/,-,g'
else
echo "tag=latest"
fi >> ${GITHUB_OUTPUT}
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
name: Set up Docker Buildx
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ matrix.rhel }}-${{ steps.tag.outputs.tag }}
file: base-${{ matrix.rhel }}/Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max