Skip to content

new way of making images #44

new way of making images

new way of making images #44

Workflow file for this run

name: Build and publish a Docker image
on:
workflow_dispatch:
pull_request:
push:
env:
REGISTRY: ghcr.io
IMAGE_NAME: mollux/docker-mautic #${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
matrix:
mautic_version: [5.x-dev]
image_type: [apache, fpm]
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- 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@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
file: ${{ matrix.image_type }}/Dockerfile
context: .
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache-${{ matrix.mautic_version }}-${{ matrix.image_type }}
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache-${{ matrix.mautic_version }}-${{ matrix.image_type }},mode=max,image-manifest=true
# platforms: linux/amd64,linux/arm64
build-args: |
MAUTIC_VERSION=${{ matrix.mautic_version }}
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.mautic_version }}-${{ matrix.image_type }}
labels: ${{ steps.meta.outputs.labels }}