Skip to content

2025.3.5

2025.3.5 #64

name: Docker Build
on:
push:
branches:
- ariac2025
tags:
- 'v*'
paths-ignore:
- 'README.md'
- '*.md'
- 'docs/**'
- '.github/workflows/**'
pull_request:
branches:
- ariac2025
paths-ignore:
- 'README.md'
- '*.md'
- 'docs/**'
release:
types: [published]
schedule:
- cron: '0 2 * * 0' # Weekly on Sunday at 2 AM UTC
env:
REGISTRY: docker.io
IMAGE_NAME: nistariac/ariac2025
jobs:
build-and-push:
runs-on: ubuntu-latest
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 Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=match,pattern=^(202[5-9]\.\d+\.\d+)$,group=1
type=match,pattern=^v(202[5-9]\.\d+\.\d+)$,group=1
type=match,pattern=^(smoke_test)$,group=1
type=match,pattern=^(final)$,group=1
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max