Skip to content

Remove arm64 platform build job (#92) #3

Remove arm64 platform build job (#92)

Remove arm64 platform build job (#92) #3

name: Publish to GitHub container registry
on:
push:
branches: [ "master" ]
jobs:
publish-containers:
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
project:
- dockerfile: ./src/ImageHosting.Storage.WebApi/Dockerfile
image: ghcr.io/baklanov-soft/image-hosting-storage-webapi
- dockerfile: ./src/ImageHosting.Storage.Tagger/Dockerfile
image: ghcr.io/baklanov-soft/image-hosting-storage-tagger
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ matrix.platform }}
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.project.image }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.project.dockerfile }}
platforms: ${{ matrix.platform }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max