/
action.yaml
59 lines (51 loc) · 1.72 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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: kumina/postfix_exporter
path: 'postfix_exporter'
ref: 'a6f58e9b2b2b4decc7e65c5a34b4fd53cd6665f1' # 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