Skip to content

feat(ci): Setup CI workflow with code generation test suite #9

feat(ci): Setup CI workflow with code generation test suite

feat(ci): Setup CI workflow with code generation test suite #9

Workflow file for this run

name: Create and publish a Docker image
on:
workflow_dispatch:
pull_request:
branches: [main]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract metadata for backend
id: meta-backend
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/backend
tags: |
type=ref,event=branch
type=sha,format=short
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Extract metadata for ingester
id: meta-ingester
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/ingester
tags: |
type=ref,event=branch
type=sha,format=short
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image for backend
id: push-backend
uses: docker/build-push-action@v6
with:
context: .
push: true
file: ./backend.dockerfile
tags: ${{ steps.meta-backend.outputs.tags }}
labels: ${{ steps.meta-backend.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push Docker image for ingester
id: push-ingester
uses: docker/build-push-action@v6
with:
context: .
push: true
file: ./ingester.dockerfile
tags: ${{ steps.meta-ingester.outputs.tags }}
labels: ${{ steps.meta-ingester.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max