Skip to content

REVERT ME x2

REVERT ME x2 #5

name: Build Time Server Image
on:
push:
branches:
- trunk
- phillip/251209-add-caching-accelerator-cookbook # TODO: Remove
paths:
- 'caching/accelerator/time_server/**'
- '.github/workflows/build-time-server.yml'
# pull_request:
# paths:
# - 'caching/accelerator/time_server/**'
# - '.github/workflows/build-time-server.yml'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: spiceai/cookbook-time-server
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=true
type=sha,prefix=
- name: Build and push Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: caching/accelerator/time_server
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