Skip to content

ci: configure buildx to compile images for arm64 architecture #4

ci: configure buildx to compile images for arm64 architecture

ci: configure buildx to compile images for arm64 architecture #4

Workflow file for this run

name: Build and Push
on:
push:
branches: [ "main" ]
env:
REGISTRY: ghcr.io
# Формує ім'я виду: ghcr.io/твій_юзернейм/serotonin_script
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # Дозвіл на запис у GHCR
strategy:
matrix:
target: [backend, worker, scheduler]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.target }}
tags: |
type=raw,value=latest
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: infra/docker/Dockerfile
target: ${{ matrix.target }}
platforms: linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}