Skip to content

Commit

Permalink
Added auto build to repo
Browse files Browse the repository at this point in the history
  • Loading branch information
clivewalkden committed Dec 14, 2023
1 parent e6fa068 commit 9d06a26
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build Magento 2 MailHog Container

on:
push:
branches: [main]

env:
REGISTRY: ghcr.io
IMAGE_NAME: sozo-design/magento2-mailhog

jobs:
build-fpm:
name: Build Docker image and push to repositories
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout code
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: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Mailhog image and push to GitHub Container Registry
uses: docker/build-push-action@v5
with:
# relative path to the place where source code with Dockerfile is located
context: .
# Build for multiple platforms
platforms: linux/amd64,linux/arm64
# Note: tags has to be all lower-case
tags: |
ghcr.io/sozo-design/magento2-mailhog:latest
ghcr.io/sozo-design/magento2-mailhog:1.0.1
push: ${{ github.ref == 'refs/heads/main' }}

0 comments on commit 9d06a26

Please sign in to comment.