Skip to content

Build and Publish OHPC Lint Container #8

Build and Publish OHPC Lint Container

Build and Publish OHPC Lint Container #8

name: Build and Publish OHPC Lint Container
on:
schedule:
# Run every Monday at 06:00 UTC
- cron: '0 6 * * 1'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: openhpc/ohpc-lint
jobs:
build-and-push:
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
- name: Build and push container
uses: docker/build-push-action@v6
with:
context: .
file: ./tests/ci/Containerfile.ohpc-lint
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
provenance: false # Disable provenance to avoid unknown/unknown
sbom: false # Disable sbom to avoid unknown/unknown
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Output image details
run: |
echo "Container built and pushed successfully!"
echo "Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
echo "Tags: ${{ steps.meta.outputs.tags }}"