-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (67 loc) · 2.83 KB
/
Copy pathdockerx_smtp_r.yml
File metadata and controls
67 lines (67 loc) · 2.83 KB
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
60
61
62
63
64
65
66
67
name: Build and Push SMTP-R Images
on:
push:
branches-ignore:
- none
paths:
- "smtp_r/**"
workflow_dispatch:
jobs:
build:
name: Build
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
config:
- { dockerfile: "smtp_r/Dockerfile", context: "smtp_r", image_name: "smtp_r", tag_name: "latest", platforms: "linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8" }
- { dockerfile: "smtp_r/Dockerfile.legacy", context: "smtp_r", image_name: "smtp_r", tag_name: "legacy", platforms: "linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8" }
- { dockerfile: "smtp_r/Dockerfile.pypy", context: "smtp_r", image_name: "smtp_r", tag_name: "pypy", platforms: "linux/386,linux/amd64,linux/arm64/v8" }
- { dockerfile: "smtp_r/Dockerfile.legacy-pypy", context: "smtp_r", image_name: "smtp_r", tag_name: "legacy-pypy", platforms: "linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8" }
runs-on: [self-hosted, ubuntu, latest]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Read image version
id: version
run: echo "version=$(tr -d '\r\n' < ${{ matrix.config.context }}/VERSION)" >> $GITHUB_OUTPUT
- name: Set tag names based on branch
id: set_tag
run: |
VERSION=${{ steps.version.outputs.version }}
TAG_NAME=${{ matrix.config.tag_name }}
if [[ "$TAG_NAME" == "latest" ]]; then
VERSION_TAG="$VERSION"
else
VERSION_TAG="$VERSION-$TAG_NAME"
fi
if [[ "${{ github.ref_name }}" == "master" ]]; then
echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT
echo "version_tag=$VERSION_TAG" >> $GITHUB_OUTPUT
else
GITHUB_REFNAME=${{ github.ref_name }}
BRANCH_NAME=${GITHUB_REFNAME//\//_}
echo "tag=$TAG_NAME-$BRANCH_NAME" >> $GITHUB_OUTPUT
echo "version_tag=$VERSION_TAG-$BRANCH_NAME" >> $GITHUB_OUTPUT
fi
- name: Build and push
uses: docker/build-push-action@v7
with:
context: ${{ matrix.config.context }}
file: ${{ matrix.config.dockerfile }}
platforms: ${{ matrix.config.platforms }}
push: true
sbom: true
provenance: mode=max
tags: |
hivesolutions/${{ matrix.config.image_name }}:${{ steps.set_tag.outputs.tag }}
hivesolutions/${{ matrix.config.image_name }}:${{ steps.set_tag.outputs.version_tag }}