Skip to content

Merge

Merge #12

Workflow file for this run

name: Build and Push Docker Images
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [released]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
packages: write
jobs:
build_and_push:
runs-on: ubuntu-latest
strategy:
matrix:
image: [backend, frontend]
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.11.1
- name: Login to GitHub Container Registry
uses: docker/login-action@v3.5.0
if: ${{ !github.event.pull_request.head.repo.fork }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate docker image tags
id: metadata
uses: docker/metadata-action@v5
with:
images: |
name=ghcr.io/${{ github.repository }}-${{ matrix.image }}
- name: Build and push image
uses: docker/build-push-action@v6.18.0
with:
context: ${{ matrix.image }}
platforms: linux/amd64,linux/arm64
push: ${{ !github.event.pull_request.head.repo.fork }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}