Skip to content

chore: add tests for build docker image when dockerfile changed #8

chore: add tests for build docker image when dockerfile changed

chore: add tests for build docker image when dockerfile changed #8

Workflow file for this run

name: Build API docker image
on:
pull_request:
branches:
- "main"
paths:
- api/Dockerfile
concurrency:
group: docker-build-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-api-docker:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: linux/amd64
service_name: "build-api-amd64"
context: "api"
- platform: linux/arm64
service_name: "build-api-arm64"
context: "api"
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
id: build
uses: docker/build-push-action@v6
with:
push: false
context: "{{defaultContext}}:${{ matrix.context }}"
platforms: ${{ matrix.platform }}
cache-from: type=gha,scope=${{ matrix.service_name }}