Docker Image Mailbox (mailpit) #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow | |
--- | |
name: Docker Image Mailbox (mailpit) | |
on: | |
schedule: | |
- cron: "0 6 1 * *" | |
workflow_dispatch: | |
push: | |
paths: | |
- images/.trigger | |
- images/mailbox/** | |
branches: | |
- main | |
jobs: | |
mailbox: | |
name: mailbox | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- BUILD_TAG: "latest" | |
IMAGE_TAG: "v1.15" | |
- BUILD_TAG: "1.15" | |
IMAGE_TAG: "v1.15" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: mirror.gcr.io/tonistiigi/binfmt:latest | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
driver-opts: image=moby/buildkit:master | |
config-inline: | | |
[registry."docker.io"] | |
mirrors = ["${{ secrets.DOCKER_PROXY }}"] | |
- uses: supplypike/setup-bin@v3 | |
with: | |
uri: https://github.com/hairyhenderson/gomplate/releases/latest/download/gomplate_linux-amd64 | |
name: gomplate | |
version: latest | |
- name: Generate Dockerfile | |
run: gomplate -f images/mailbox/tpl.Dockerfile -o images/mailbox/Dockerfile | |
env: | |
IMAGE_TAG: ${{ matrix.IMAGE_TAG }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: images/mailbox/context | |
file: images/mailbox/Dockerfile | |
push: true | |
platforms: "linux/amd64,linux/arm64" | |
tags: ${{ vars.DOCKER_REPO }}/mailbox:${{ matrix.BUILD_TAG }} | |
cache-from: type=registry,ref=${{ vars.DOCKER_REPO }}/mailbox:${{ matrix.BUILD_TAG }} | |
cache-to: type=inline |