Skip to content

Fix: helm template fixes for prometheus monitoring #23

Fix: helm template fixes for prometheus monitoring

Fix: helm template fixes for prometheus monitoring #23

Workflow file for this run

name: Docker tag image
on:
push:
tags: [ 'v*.*.*' ]
jobs:
Unit_Tests:
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/unit-tests
Integration_Tests:
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/integration-tests
with:
XOAUTH2_RELAYHOST_USERNAME: ${{ secrets.XOAUTH2_RELAYHOST_USERNAME }}
XOAUTH2_CLIENT_ID: ${{ secrets.XOAUTH2_CLIENT_ID }}
XOAUTH2_SECRET: ${{ secrets.XOAUTH2_SECRET }}
XOAUTH2_INITIAL_REFRESH_TOKEN: ${{ secrets.XOAUTH2_INITIAL_REFRESH_TOKEN }}
Helm_chart_Tests:
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/helm-chart-tests
Build_PostfixExporter:
runs-on: ubuntu-latest
needs:
- Helm_chart_Tests
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/build-postfix-exporter
with:
DOCKER_ACCESS_TOKEN: '${{ secrets.DOCKER_ACCESS_TOKEN }}'
tags: |
boky/postfix-exporter:latest
boky/postfix-exporter:edge
# boky/postfix-exporter:${{ env.RELEASE_VERSION }}
# boky/postfix-exporter:${{ env.RELEASE_VERSION_NO_v }}
Build_Alpine:
runs-on: ubuntu-latest
needs:
- Unit_Tests
- Integration_Tests
- Helm_chart_Tests
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Buildkit setup
- uses: ./.github/actions/buildx-setup
# Docker hub login
- uses: ./.github/actions/docker-hub-login
with:
DOCKER_ACCESS_TOKEN: '${{ secrets.DOCKER_ACCESS_TOKEN }}'
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
#key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
key: ${{ runner.os }}-alpine-${{ github.sha }}
restore-keys: |
${{ runner.os }}-alpine-
- name: Fix issue with building Alpine # See https://gitlab.alpinelinux.org/alpine/aports/-/issues/12406
run: |
update-binfmts --enable
- name: Build and push Alpine
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
boky/postfix:latest-alpine
boky/postfix:${{ env.RELEASE_VERSION }}-alpine
boky/postfix:${{ env.RELEASE_VERSION_NO_v }}-alpine
# linux/s390x: "rsyslog (no such package)"
# Latest Alpine does not have all packages for 386 any more :-(
platforms: "linux/arm/v6,linux/arm/v7,linux/ppc64le,linux/amd64,linux/arm64"
cache-from: type=local,src=/tmp/.buildx-cache/alpine,mode=max,compression=estargz
cache-to: type=local,dest=/tmp/.buildx-cache-new/alpine
build-args: |
BASE_IMAGE=alpine:latest
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
Build_Ubuntu:
runs-on: ubuntu-latest
needs:
- Unit_Tests
- Integration_Tests
- Helm_chart_Tests
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Buildkit setup
- uses: ./.github/actions/buildx-setup
# Docker hub login
- uses: ./.github/actions/docker-hub-login
with:
DOCKER_ACCESS_TOKEN: '${{ secrets.DOCKER_ACCESS_TOKEN }}'
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
#key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
key: ${{ runner.os }}-ubuntu-${{ github.sha }}
restore-keys: |
${{ runner.os }}-ubuntu-
- name: Build and push Ubuntu
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
boky/postfix:latest-ubuntu
boky/postfix:${{ env.RELEASE_VERSION }}-ubuntu
boky/postfix:${{ env.RELEASE_VERSION_NO_v }}-ubuntu
platforms: "linux/arm/v7,linux/amd64,linux/arm64,linux/ppc64le,linux/s390x"
cache-from: type=local,src=/tmp/.buildx-cache/ubuntu,mode=max,compression=estargz
cache-to: type=local,dest=/tmp/.buildx-cache-new/ubuntu
build-args: |
BASE_IMAGE=ubuntu:jammy
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
Build_Debian:
runs-on: ubuntu-latest
needs:
- Unit_Tests
- Integration_Tests
- Helm_chart_Tests
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Buildkit setup
- uses: ./.github/actions/buildx-setup
# Docker hub login
- uses: ./.github/actions/docker-hub-login
with:
DOCKER_ACCESS_TOKEN: '${{ secrets.DOCKER_ACCESS_TOKEN }}'
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
#key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
key: ${{ runner.os }}-debian-${{ github.sha }}
restore-keys: |
${{ runner.os }}-debian-
- name: Build and push Debian
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
boky/postfix:latest
boky/postfix:latest-debian
boky/postfix:${{ env.RELEASE_VERSION }}
boky/postfix:${{ env.RELEASE_VERSION_NO_v }}
boky/postfix:${{ env.RELEASE_VERSION }}-debian
boky/postfix:${{ env.RELEASE_VERSION_NO_v }}-debian
platforms: "linux/386,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/arm64,linux/mips64le,linux/ppc64le,linux/s390x"
cache-from: type=local,src=/tmp/.buildx-cache/debian,mode=max,compression=estargz
cache-to: type=local,dest=/tmp/.buildx-cache-new/debian
build-args: |
BASE_IMAGE=debian:bookworm
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
Release:
runs-on: ubuntu-latest
needs:
- Unit_Tests
- Integration_Tests
- Helm_chart_Tests
- Build_Alpine
- Build_Ubuntu
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Release version setup
- uses: ./.github/actions/get-release-version
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: "gh-pages"
path: "gh-pages"
fetch-depth: 1
- name: Copy `README.md` and `LICENCE` into the helm chart
id: readme_and_licence
shell: bash
run: cp README.md LICENSE helm/mail/
- name: Changelog
uses: Bullrich/generate-release-changelog@master
id: Changelog
env:
REPO: ${{ github.repository }}
# TODO: Include the changelog in Chart.yml as annotations.artifacthub.io/changes
# See more here: https://artifacthub.io/docs/topics/annotations/helm/#supported-annotations
- name: Package helm chart with vX.Y.Z
uses: WyriHaximus/github-action-helm3@v3
with:
exec: helm package --app-version $RELEASE_VERSION --version "${RELEASE_VERSION}" --destination ./gh-pages helm/mail
- name: Package helm chart with X.Y.Z
uses: WyriHaximus/github-action-helm3@v3
with:
exec: helm package --app-version "${RELEASE_VERSION_NO_v}" --version "${RELEASE_VERSION_NO_v}" --destination ./gh-pages helm/mail
- name: Create helm chart index
uses: WyriHaximus/github-action-helm3@v3
with:
exec: cd gh-pages && rm -rf .git && helm repo index . --url https://bokysan.github.io/docker-postfix
- name: Upload gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages
tag_name: gh-pages-${{ steps.version_number.outputs.RELEASE_VERSION }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: false