Skip to content

feat: Flexprice integration #127

feat: Flexprice integration

feat: Flexprice integration #127

name: Docker Build Check
on:
pull_request:
branches: [main]
workflow_dispatch:
inputs:
publish:
description: Push images to GitHub Container Registry
required: false
type: boolean
default: false
env:
REGISTRY: ghcr.io
API_IMAGE_NAME: ${{ github.repository }}-api
WORKER_IMAGE_NAME: ${{ github.repository }}-worker
jobs:
build-api:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU (for multi-platform builds)
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
if: github.event_name == 'workflow_dispatch' && inputs.publish == true
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for API image
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.API_IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=raw,value=latest,enable={{is_default_branch}}
- name: Build API image (amd64 only for speed)
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile.api
push: ${{ github.event_name == 'workflow_dispatch' && inputs.publish == true }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=api-check
cache-to: type=gha,scope=api-check,mode=max
platforms: linux/amd64
build-worker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU (for multi-platform builds)
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
if: github.event_name == 'workflow_dispatch' && inputs.publish == true
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Worker image
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.WORKER_IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=raw,value=latest,enable={{is_default_branch}}
- name: Build Worker image (amd64 only for speed)
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile.worker
push: ${{ github.event_name == 'workflow_dispatch' && inputs.publish == true }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=worker-check
cache-to: type=gha,scope=worker-check,mode=max
platforms: linux/amd64
build-args: |
INSTALL_EXTRAS=qualitative-voice