mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-06 06:25:40 +08:00
59 lines
1.7 KiB
YAML
59 lines
1.7 KiB
YAML
name: 'Build the postfix-exporter'
|
|
description: 'Build the latest version of postfix-exporter'
|
|
|
|
inputs:
|
|
DOCKER_ACCESS_TOKEN:
|
|
description: 'DOCKER_ACCESS_TOKEN'
|
|
required: true
|
|
tags:
|
|
description: 'Docker image tags'
|
|
required: true
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: Hsn723/postfix_exporter # Hsn723 repo is actually being updated
|
|
path: 'postfix_exporter'
|
|
ref: 'v0.7.0' # Latest commit we know that works
|
|
|
|
- name: Apply patches
|
|
shell: bash
|
|
run: |
|
|
cd postfix_exporter
|
|
git apply ../postfix-exporter-*.patch
|
|
|
|
# Buildkit setup
|
|
- uses: ./.github/actions/buildx-setup
|
|
|
|
# Docker hub login
|
|
- uses: ./.github/actions/docker-hub-login
|
|
with:
|
|
DOCKER_ACCESS_TOKEN: '${{ inputs.DOCKER_ACCESS_TOKEN }}'
|
|
|
|
- name: Cache Docker layers
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: /tmp/.buildx-cache
|
|
key: ${{ runner.os }}-postfix-exporter-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-postfix-exporter-
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: postfix_exporter
|
|
push: true
|
|
tags: '${{ inputs.tags }}'
|
|
platforms: "linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x"
|
|
# linux/386,linux/arm/v6,linux/arm64,linux/riscv64"
|
|
cache-from: type=local,src=/tmp/.buildx-cache/postfix-exporter,mode=max,compression=estargz
|
|
cache-to: type=local,dest=/tmp/.buildx-cache-new/postfix-exporter
|
|
|
|
- name: Move cache
|
|
shell: bash
|
|
run: |
|
|
rm -rf /tmp/.buildx-cache
|
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|