Skip to content

build: image build

build: image build #1

Workflow file for this run

name: Build and Push Images
on:
push:
branches:
- main
tags:
- 'v*.*.*'
workflow_dispatch:
jobs:
bake:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }} # Docker Hub username (use GitHub actor if using GHCR)
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build and push
uses: docker/bake-action@v6
with:
# Points to your bake file - adjust if you named it differently
files: |
./docker-bake.hcl
# Set to true to push images to registry
push: true
# Optional: Override variables defined in the bake file
set: |
*.labels.org.opencontainers.image.created=${{ fromJSON(github.event.head_commit.timestamp || '"2025-04-27T10:34:00Z"') }}
*.labels.org.opencontainers.image.revision=${{ github.sha }}
*.cache-from=type=gha
*.cache-to=type=gha,mode=max