Build canary image tags on branch pushes

This commit is contained in:
Felipe Domingues 2026-04-30 16:11:41 -03:00
parent 9722215b11
commit 7d0ab90722

View file

@ -2,7 +2,13 @@ name: Build and Push Docker Image
on: on:
push: push:
branches: [main] branches:
- main
- "codex/**"
pull_request:
branches:
- main
workflow_dispatch:
jobs: jobs:
build-and-push: build-and-push:
@ -15,7 +21,22 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/domfelipe/hermes-agent-custom
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=ref,event=pr
type=sha
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ghcr.io registry: ghcr.io
@ -26,5 +47,6 @@ jobs:
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
push: true push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/domfelipe/hermes-agent-custom:latest tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}