@ -58,15 +58,15 @@ on:
required : true
required : true
type : string
type : string
deploy:
deploy:
description : Deploy to docker hub. Happens for all branches but staging
description : Deploy to docker hub. Happens for all branches but staging . Use string true or false.
default : true
default : true
required : false
required : false
type : boolean
type : string
release:
release:
description : 'Tag and create the github release. Only happens for branch x.y (release branch)'
description : Tag and create the github release. Use string true or false.
default : false
default : false
required : false
required : false
type : boolean
type : string
env:
env:
HCL_FILE : ./tests/build.hcl
HCL_FILE : ./tests/build.hcl
@ -84,7 +84,7 @@ jobs:
- name : Create matrix
- name : Create matrix
id : targets
id : targets
run : |
run : |
echo ::set-output name=matrix:: $(docker buildx bake -f ${{env.HCL_FILE}} --print | jq -cr '.group.default.targets')
echo matrix= $(docker buildx bake -f ${{env.HCL_FILE}} --print | jq -cr '.group.default.targets') >> $GITHUB_OUTPUT
- name : Show matrix
- name : Show matrix
run : |
run : |
echo ${{ steps.targets.outputs.matrix }}
echo ${{ steps.targets.outputs.matrix }}
@ -107,26 +107,25 @@ jobs:
echo "MAILU_VERSION=${{ inputs.mailu_version }}" >> $GITHUB_ENV
echo "MAILU_VERSION=${{ inputs.mailu_version }}" >> $GITHUB_ENV
echo "PINNED_MAILU_VERSION=${{ inputs.pinned_mailu_version }}" >> $GITHUB_ENV
echo "PINNED_MAILU_VERSION=${{ inputs.pinned_mailu_version }}" >> $GITHUB_ENV
echo "DOCKER_ORG=${{ inputs.docker_org }}" >> $GITHUB_ENV
echo "DOCKER_ORG=${{ inputs.docker_org }}" >> $GITHUB_ENV
- name : Configure actions/cache@v3 action for storing build cache of base image in the ${{ runner.temp }}/cache folder
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/base
key : mailu-base-${{ inputs.architecture }}-${{ hashFiles('core/base/Dockerfile','core/base/requirements-prod.txt') }}-${{ github.run_id }}
restore-keys : |
mailu-base-${{ inputs.architecture }}-${{hashFiles('core/base/Dockerfile','core/base/requirements-prod.txt') }}
- name : Set up QEMU
- name : Set up QEMU
uses : docker/setup-qemu-action@v2
uses : docker/setup-qemu-action@v2
- uses : crazy-max/ghaction-github-runtime@v2
- uses : crazy-max/ghaction-github-runtime@v2
- name : Set up Docker Buildx
- name : Set up Docker Buildx
uses : docker/setup-buildx-action@v2
uses : docker/setup-buildx-action@v2
- name : Login to Docker Hub
- name : Login to GitHub Container Registry
uses : docker/login-action@v2
uses : docker/login-action@v2
with:
with:
username : ${{ secrets.Docker_Login }}
registry : ghcr.io
password : ${{ secrets.Docker_Password }}
username : ${{ github.repository_owner }}
password : ${{ secrets.GITHUB_TOKEN }}
- name : Helper to convert docker org to lowercase
id : string
uses : ASzc/change-string-case-action@v2
with:
string : ${{ github.repository_owner }}
- name : Build all docker images
- name : Build all docker images
env:
env:
DOCKER_ORG : ${{ env.DOCKER_ORG }}
DOCKER_ORG : ghcr.io/${{ steps.string.outputs.lowercase }}
MAILU_VERSION : ${{ env.MAILU_VERSION }}
MAILU_VERSION : ${{ env.MAILU_VERSION }}
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
uses : docker/bake-action@v2
uses : docker/bake-action@v2
@ -136,8 +135,8 @@ jobs:
load : false
load : false
push : false
push : false
set : |
set : |
*.cache-from=type= local,src=${{ runner.temp }}/cache/base
*.cache-from=type= registry,ref=ghcr.io/${{ steps.string.outputs.lowercase }}/base:${{ hashFiles('core/base/Dockerfile','core/base/requirements-prod.txt') }}
*.cache-to=type= local,dest=${{ runner.temp }}/cache/base ,mode=max
*.cache-to=type= registry,ref=ghcr.io/${{ steps.string.outputs.lowercase }}/base:${{ hashFiles('core/base/Dockerfile','core/base/requirements-prod.txt') }} ,mode=max
*.platform=${{ inputs.architecture }}
*.platform=${{ inputs.architecture }}
# This job builds all the images. The build cache is stored in the github actions cache.
# This job builds all the images. The build cache is stored in the github actions cache.
@ -165,33 +164,25 @@ jobs:
echo "MAILU_VERSION=${{ inputs.mailu_version }}" >> $GITHUB_ENV
echo "MAILU_VERSION=${{ inputs.mailu_version }}" >> $GITHUB_ENV
echo "PINNED_MAILU_VERSION=${{ inputs.pinned_mailu_version }}" >> $GITHUB_ENV
echo "PINNED_MAILU_VERSION=${{ inputs.pinned_mailu_version }}" >> $GITHUB_ENV
echo "DOCKER_ORG=${{ inputs.docker_org }}" >> $GITHUB_ENV
echo "DOCKER_ORG=${{ inputs.docker_org }}" >> $GITHUB_ENV
- name : Configure actions/cache@v3 action for storing build cache of base image in the ${{ runner.temp }}/cache folder
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/base
key : mailu-base-${{ inputs.architecture }}-${{ hashFiles('core/base/Dockerfile','core/base/requirements-prod.txt') }}-${{ github.run_id }}
restore-keys : |
mailu-base-${{ inputs.architecture }}-${{ hashFiles('core/base/Dockerfile','core/base/requirements-prod.txt') }}
- name : Configure actions/cache@v3 action for storing build cache in the ${{ runner.temp }}/cache folder
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/${{ matrix.target }}
key : ${{ matrix.target }}-${{ inputs.architecture }}-${{ github.run_id }}
restore-keys : |
${{ github.ref }}-${{ inputs.mailu_version }}-${{ matrix.target }}
- name : Set up QEMU
- name : Set up QEMU
uses : docker/setup-qemu-action@v2
uses : docker/setup-qemu-action@v2
- uses : crazy-max/ghaction-github-runtime@v2
- uses : crazy-max/ghaction-github-runtime@v2
- name : Set up Docker Buildx
- name : Set up Docker Buildx
uses : docker/setup-buildx-action@v2
uses : docker/setup-buildx-action@v2
- name : Login to Docker Hub
- name : Login to GitHub Container Registry
uses : docker/login-action@v2
uses : docker/login-action@v2
with:
with:
username : ${{ secrets.Docker_Login }}
registry : ghcr.io
password : ${{ secrets.Docker_Password }}
username : ${{ github.repository_owner }}
password : ${{ secrets.GITHUB_TOKEN }}
- name : Helper to convert docker org to lowercase
id : string
uses : ASzc/change-string-case-action@v2
with:
string : ${{ github.repository_owner }}
- name : Build all docker images
- name : Build all docker images
env:
env:
DOCKER_ORG : ${{ env.DOCKER_ORG }}
DOCKER_ORG : ghcr.io/${{ steps.string.outputs.lowercase }}
MAILU_VERSION : ${{ env.MAILU_VERSION }}
MAILU_VERSION : ${{ env.MAILU_VERSION }}
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
uses : docker/bake-action@v2
uses : docker/bake-action@v2
@ -199,11 +190,11 @@ jobs:
files : ${{env.HCL_FILE}}
files : ${{env.HCL_FILE}}
targets : ${{ matrix.target }}
targets : ${{ matrix.target }}
load : false
load : false
push : fals e
push : tru e
set : |
set : |
*.cache-from=type= local,src=${{ runner.temp }}/cache/${{ matrix.target }}
*.cache-from=type= registry,ref=ghcr.io/${{ steps.string.outputs.lowercase }}/${{ matrix.target }}:buildcache
*.cache- from=type=local,src=${{ runner.temp }}/cache/base
*.cache- to=type=registry,ref=ghcr.io/${{ steps.string.outputs.lowercase }}/${{ matrix.target }}:buildcache,mode=max
*.cache- to=type=local,dest=${{ runner.temp }}/cache/${{ matrix.target }},mode=max
*.cache- from=type=registry,ref=ghcr.io/${{ steps.string.outputs.lowercase }}/base:${{ hashFiles('core/base/Dockerfile','core/base/requirements-prod.txt') }}
*.platform=${{ inputs.architecture }}
*.platform=${{ inputs.architecture }}
# This job builds all the images. The build cache is stored in the github actions cache.
# This job builds all the images. The build cache is stored in the github actions cache.
@ -231,33 +222,25 @@ jobs:
echo "MAILU_VERSION=${{ inputs.mailu_version }}" >> $GITHUB_ENV
echo "MAILU_VERSION=${{ inputs.mailu_version }}" >> $GITHUB_ENV
echo "PINNED_MAILU_VERSION=${{ inputs.pinned_mailu_version }}" >> $GITHUB_ENV
echo "PINNED_MAILU_VERSION=${{ inputs.pinned_mailu_version }}" >> $GITHUB_ENV
echo "DOCKER_ORG=${{ inputs.docker_org }}" >> $GITHUB_ENV
echo "DOCKER_ORG=${{ inputs.docker_org }}" >> $GITHUB_ENV
- name : Configure actions/cache@v3 action for storing build cache of base image in the ${{ runner.temp }}/cache folder
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/base
key : mailu-base-${{ inputs.architecture }}-${{ hashFiles('core/base/Dockerfile','core/base/requirements-prod.txt') }}-${{ github.run_id }}
restore-keys : |
mailu-base-${{ inputs.architecture }}-${{ hashFiles('core/base/Dockerfile','core/base/requirements-prod.txt') }}
- name : Configure actions/cache@v3 action for storing build cache in the ${{ runner.temp }}/cache folder
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/${{ matrix.target }}
key : ${{ matrix.target }}-${{ inputs.architecture }}-${{ github.run_id }}
restore-keys : |
${{ matrix.target }}-${{ inputs.architecture }}
- name : Set up QEMU
- name : Set up QEMU
uses : docker/setup-qemu-action@v2
uses : docker/setup-qemu-action@v2
- uses : crazy-max/ghaction-github-runtime@v2
- uses : crazy-max/ghaction-github-runtime@v2
- name : Set up Docker Buildx
- name : Set up Docker Buildx
uses : docker/setup-buildx-action@v2
uses : docker/setup-buildx-action@v2
- name : Login to Docker Hub
- name : Login to GitHub Container Registry
uses : docker/login-action@v2
uses : docker/login-action@v2
with:
with:
username : ${{ secrets.Docker_Login }}
registry : ghcr.io
password : ${{ secrets.Docker_Password }}
username : ${{ github.repository_owner }}
password : ${{ secrets.GITHUB_TOKEN }}
- name : Helper to convert docker org to lowercase
id : string
uses : ASzc/change-string-case-action@v2
with:
string : ${{ github.repository_owner }}
- name : Build all docker images
- name : Build all docker images
env:
env:
DOCKER_ORG : ${{ env.DOCKER_ORG }}
DOCKER_ORG : ghcr.io/${{ steps.string.outputs.lowercase }}
MAILU_VERSION : ${{ env.MAILU_VERSION }}
MAILU_VERSION : ${{ env.MAILU_VERSION }}
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
uses : docker/bake-action@v2
uses : docker/bake-action@v2
@ -267,9 +250,10 @@ jobs:
load : false
load : false
push : false
push : false
set : |
set : |
*.cache-from=type=local,src=${{ runner.temp }}/cache/${{ matrix.target }}
*.cache-from=type=registry,ref=ghcr.io/${{ steps.string.outputs.lowercase }}/${{ matrix.target }}:buildcache-arm
*.cache-from=type=local,src=${{ runner.temp }}/cache/base
*.cache-to=type=registry,ref=ghcr.io/${{ steps.string.outputs.lowercase }}/${{ matrix.target }}:buildcache-arm,mode=max
*.cache-to=type=local,dest=${{ runner.temp }}/cache/${{ matrix.target }},mode=max
*.cache-from=type=registry,ref=ghcr.io/${{ steps.string.outputs.lowercase }}/base:${{ hashFiles('core/base/Dockerfile','core/base/requirements-prod.txt') }}-arm
*.cache-to=type=registry,ref=ghcr.io/${{ steps.string.outputs.lowercase }}/base:${{ hashFiles('core/base/Dockerfile','core/base/requirements-prod.txt') }}-arm,mode=max
*.platform=${{ inputs.architecture }}
*.platform=${{ inputs.architecture }}
# This job runs all the tests.
# This job runs all the tests.
@ -303,112 +287,22 @@ jobs:
echo "MAILU_VERSION=${{ inputs.mailu_version }}" >> $GITHUB_ENV
echo "MAILU_VERSION=${{ inputs.mailu_version }}" >> $GITHUB_ENV
echo "PINNED_MAILU_VERSION=${{ inputs.pinned_mailu_version }}" >> $GITHUB_ENV
echo "PINNED_MAILU_VERSION=${{ inputs.pinned_mailu_version }}" >> $GITHUB_ENV
echo "DOCKER_ORG=${{ inputs.docker_org }}" >> $GITHUB_ENV
echo "DOCKER_ORG=${{ inputs.docker_org }}" >> $GITHUB_ENV
- name : Configure /cache for image docs
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/docs
key : docs-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image setup
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/setup
key : setup-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image admin
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/admin
key : admin-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image antispam
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/antispam
key : antispam-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image front
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/front
key : front-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image imap
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/imap
key : imap-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image smtp
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/smtp
key : smtp-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image snappymail
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/snappymail
key : snappymail-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image roundcube
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/roundcube
key : roundcube-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image antivirus
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/antivirus
key : antivirus-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image fetchmail
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/fetchmail
key : fetchmail-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image resolver
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/resolver
key : resolver-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image traefik-certdumper
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/traefik-certdumper
key : traefik-certdumper-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image webdav
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/webdav
key : webdav-${{ inputs.architecture }}-${{ github.run_id }}
- name : Set up QEMU
- name : Set up QEMU
uses : docker/setup-qemu-action@v2
uses : docker/setup-qemu-action@v2
- uses : crazy-max/ghaction-github-runtime@v2
- uses : crazy-max/ghaction-github-runtime@v2
- name : Set up Docker Buildx
- name : Set up Docker Buildx
uses : docker/setup-buildx-action@v2
uses : docker/setup-buildx-action@v2
- name : Login to Docker Hub
- name : Login to GitHub Container Registry
uses : docker/login-action@v2
uses : docker/login-action@v2
with:
with:
username : ${{ secrets.Docker_Login }}
registry : ghcr.io
password : ${{ secrets.Docker_Password }}
username : ${{ github.repository_owner }}
- name : Build docker images for testing from cache
password : ${{ secrets.GITHUB_TOKEN }}
env:
- name : Helper to convert docker org to lowercase
DOCKER_ORG : ${{ env.DOCKER_ORG }}
id : string
MAILU_VERSION : ${{ env.MAILU_VERSION }}
uses : ASzc/change-string-case-action@v2
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
uses : docker/bake-action@v2
with:
with:
files : ${{env.HCL_FILE}}
string : ${{ github.repository_owner }}
load : true
push : false
set : |
*.cache-from=type=local,src=${{ runner.temp }}/cache/docs
*.cache-from=type=local,src=${{ runner.temp }}/cache/setup
*.cache-from=type=local,src=${{ runner.temp }}/cache/admin
*.cache-from=type=local,src=${{ runner.temp }}/cache/antispam
*.cache-from=type=local,src=${{ runner.temp }}/cache/front
*.cache-from=type=local,src=${{ runner.temp }}/cache/imap
*.cache-from=type=local,src=${{ runner.temp }}/cache/smtp
*.cache-from=type=local,src=${{ runner.temp }}/cache/snappymail
*.cache-from=type=local,src=${{ runner.temp }}/cache/roundcube
*.cache-from=type=local,src=${{ runner.temp }}/cache/antivirus
*.cache-from=type=local,src=${{ runner.temp }}/cache/fetchmail
*.cache-from=type=local,src=${{ runner.temp }}/cache/resolver
*.cache-from=type=local,src=${{ runner.temp }}/cache/traefik-certdumper
*.cache-from=type=local,src=${{ runner.temp }}/cache/webdav
*.platform=${{ inputs.architecture }}
- name : Install python packages
- name : Install python packages
run : python3 -m pip install -r tests/requirements.txt
run : python3 -m pip install -r tests/requirements.txt
- name : Copy all certs
- name : Copy all certs
@ -416,12 +310,10 @@ jobs:
- name : Test ${{ matrix.target }}
- name : Test ${{ matrix.target }}
run : python tests/compose/test.py ${{ matrix.target }} ${{ matrix.time }}
run : python tests/compose/test.py ${{ matrix.target }} ${{ matrix.time }}
env:
env:
DOCKER_ORG : ${{ env.DOCKER_ORG }}
DOCKER_ORG : ghcr.io/${{ steps.string.outputs.lowercase }}
MAILU_VERSION : ${{ env.MAILU_VERSION }}
MAILU_VERSION : ${{ env.MAILU_VERSION }}
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
# This job deploys the docker images to the docker repository. The build.hcl file contains logic that determines what tags are pushed.
# E.g. for master only the :master and :latest tags are pushed.
deploy:
deploy:
name : Deploy images
name : Deploy images
# Deploying is not required for staging
# Deploying is not required for staging
@ -430,6 +322,10 @@ jobs:
needs:
needs:
- build
- build
- tests
- tests
strategy:
fail-fast : false
matrix:
target : [ "setup" , "docs" , "fetchmail" , "roundcube" , "admin" , "traefik-certdumper" , "radicale" , "clamav" , "rspamd" , "postfix" , "dovecot" , "unbound" , "nginx" , "snappymail" ]
steps:
steps:
- uses : actions/checkout@v3
- uses : actions/checkout@v3
- name : Retrieve global variables
- name : Retrieve global variables
@ -439,76 +335,6 @@ jobs:
echo "MAILU_VERSION=${{ inputs.mailu_version }}" >> $GITHUB_ENV
echo "MAILU_VERSION=${{ inputs.mailu_version }}" >> $GITHUB_ENV
echo "PINNED_MAILU_VERSION=${{ inputs.pinned_mailu_version }}" >> $GITHUB_ENV
echo "PINNED_MAILU_VERSION=${{ inputs.pinned_mailu_version }}" >> $GITHUB_ENV
echo "DOCKER_ORG=${{ inputs.docker_org }}" >> $GITHUB_ENV
echo "DOCKER_ORG=${{ inputs.docker_org }}" >> $GITHUB_ENV
- name : Configure /cache for image docs
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/docs
key : docs-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image setup
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/setup
key : setup-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image admin
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/admin
key : admin-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image antispam
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/antispam
key : antispam-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image front
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/front
key : front-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image imap
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/imap
key : imap-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image smtp
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/smtp
key : smtp-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image snappymail
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/snappymail
key : snappymail-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image roundcube
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/roundcube
key : roundcube-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image antivirus
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/antivirus
key : antivirus-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image fetchmail
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/fetchmail
key : fetchmail-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image resolver
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/resolver
key : resolver-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image traefik-certdumper
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/traefik-certdumper
key : traefik-certdumper-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image webdav
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/webdav
key : webdav-${{ inputs.architecture }}-${{ github.run_id }}
- name : Set up QEMU
- name : Set up QEMU
uses : docker/setup-qemu-action@v2
uses : docker/setup-qemu-action@v2
- uses : crazy-max/ghaction-github-runtime@v2
- uses : crazy-max/ghaction-github-runtime@v2
@ -519,31 +345,19 @@ jobs:
with:
with:
username : ${{ secrets.Docker_Login }}
username : ${{ secrets.Docker_Login }}
password : ${{ secrets.Docker_Password }}
password : ${{ secrets.Docker_Password }}
- name : Deploy images to docker hub. Build.hcl contains the logic for the tags that are pushed.
- name : Helper to convert docker org to lowercase
env:
id : string
DOCKER_ORG : ${{ env.DOCKER_ORG }}
uses : ASzc/change-string-case-action@v2
MAILU_VERSION : ${{ env.MAILU_VERSION }}
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
uses : docker/bake-action@v2
with:
with:
files : ${{env.HCL_FILE}}
string : ${{ github.repository_owner }}
push : true
- name : Push image to Docker
set : |
shell : bash
*.cache-from=type=local,src=${{ runner.temp }}/cache/docs
run : |
*.cache-from=type=local,src=${{ runner.temp }}/cache/setup
if [ '${{ env.MAILU_VERSION }}' == 'master' ]; then pinned_mailu_version='master'; else pinned_mailu_version=${{ env.PINNED_MAILU_VERSION}}; fi;
*.cache-from=type=local,src=${{ runner.temp }}/cache/admin
docker buildx imagetools create \
*.cache-from=type=local,src=${{ runner.temp }}/cache/antispam
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:${{ env.MAILU_VERSION }} \
*.cache-from=type=local,src=${{ runner.temp }}/cache/front
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:$pinned_mailu_version \
*.cache-from=type=local,src=${{ runner.temp }}/cache/imap
ghcr.io/${{ steps.string.outputs.lowercase }}/${{ matrix.target }}:${{ env.MAILU_VERSION }}
*.cache-from=type=local,src=${{ runner.temp }}/cache/smtp
*.cache-from=type=local,src=${{ runner.temp }}/cache/snappymail
*.cache-from=type=local,src=${{ runner.temp }}/cache/roundcube
*.cache-from=type=local,src=${{ runner.temp }}/cache/antivirus
*.cache-from=type=local,src=${{ runner.temp }}/cache/fetchmail
*.cache-from=type=local,src=${{ runner.temp }}/cache/resolver
*.cache-from=type=local,src=${{ runner.temp }}/cache/traefik-certdumper
*.cache-from=type=local,src=${{ runner.temp }}/cache/webdav
*.platform=${{ inputs.architecture }}
deploy-arm:
deploy-arm:
name : Deploy images for arm
name : Deploy images for arm
@ -552,6 +366,10 @@ jobs:
runs-on : self-hosted
runs-on : self-hosted
needs:
needs:
- build-arm
- build-arm
strategy:
fail-fast : false
matrix:
target : [ "setup" , "docs" , "fetchmail" , "roundcube" , "admin" , "traefik-certdumper" , "radicale" , "clamav" , "rspamd" , "postfix" , "dovecot" , "unbound" , "nginx" , "snappymail" ]
steps:
steps:
- uses : actions/checkout@v3
- uses : actions/checkout@v3
- name : Retrieve global variables
- name : Retrieve global variables
@ -561,76 +379,6 @@ jobs:
echo "MAILU_VERSION=${{ inputs.mailu_version }}" >> $GITHUB_ENV
echo "MAILU_VERSION=${{ inputs.mailu_version }}" >> $GITHUB_ENV
echo "PINNED_MAILU_VERSION=${{ inputs.pinned_mailu_version }}" >> $GITHUB_ENV
echo "PINNED_MAILU_VERSION=${{ inputs.pinned_mailu_version }}" >> $GITHUB_ENV
echo "DOCKER_ORG=${{ inputs.docker_org }}" >> $GITHUB_ENV
echo "DOCKER_ORG=${{ inputs.docker_org }}" >> $GITHUB_ENV
- name : Configure /cache for image docs
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/docs
key : docs-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image setup
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/setup
key : setup-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image admin
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/admin
key : admin-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image antispam
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/antispam
key : antispam-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image front
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/front
key : front-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image imap
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/imap
key : imap-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image smtp
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/smtp
key : smtp-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image snappymail
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/snappymail
key : snappymail-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image roundcube
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/roundcube
key : roundcube-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image antivirus
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/antivirus
key : antivirus-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image fetchmail
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/fetchmail
key : fetchmail-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image resolver
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/resolver
key : resolver-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image traefik-certdumper
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/traefik-certdumper
key : traefik-certdumper-${{ inputs.architecture }}-${{ github.run_id }}
- name : Configure /cache for image webdav
uses : actions/cache@v3
with:
path : ${{ runner.temp }}/cache/webdav
key : webdav-${{ inputs.architecture }}-${{ github.run_id }}
- name : Set up QEMU
- name : Set up QEMU
uses : docker/setup-qemu-action@v2
uses : docker/setup-qemu-action@v2
- uses : crazy-max/ghaction-github-runtime@v2
- uses : crazy-max/ghaction-github-runtime@v2
@ -641,31 +389,19 @@ jobs:
with:
with:
username : ${{ secrets.Docker_Login }}
username : ${{ secrets.Docker_Login }}
password : ${{ secrets.Docker_Password }}
password : ${{ secrets.Docker_Password }}
- name : Deploy images to docker hub. Build.hcl contains the logic for the tags that are pushed.
- name : Helper to convert docker org to lowercase
env:
id : string
DOCKER_ORG : ${{ env.DOCKER_ORG }}
uses : ASzc/change-string-case-action@v2
MAILU_VERSION : ${{ env.MAILU_VERSION }}
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
uses : docker/bake-action@v2
with:
with:
files : ${{env.HCL_FILE}}
string : ${{ github.repository_owner }}
push : true
- name : Push image to Docker
set : |
shell : bash
*.cache-from=type=local,src=${{ runner.temp }}/cache/docs
run : |
*.cache-from=type=local,src=${{ runner.temp }}/cache/setup
if [ '${{ env.MAILU_VERSION }}' == 'master-arm' ]; then pinned_mailu_version='master-arm'; else pinned_mailu_version=${{ env.PINNED_MAILU_VERSION}}; fi;
*.cache-from=type=local,src=${{ runner.temp }}/cache/admin
docker buildx imagetools create \
*.cache-from=type=local,src=${{ runner.temp }}/cache/antispam
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:${{ env.MAILU_VERSION }} \
*.cache-from=type=local,src=${{ runner.temp }}/cache/front
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:$pinned_mailu_version \
*.cache-from=type=local,src=${{ runner.temp }}/cache/imap
ghcr.io/${{ steps.string.outputs.lowercase }}/${{ matrix.target }}:${{ env.MAILU_VERSION }}
*.cache-from=type=local,src=${{ runner.temp }}/cache/smtp
*.cache-from=type=local,src=${{ runner.temp }}/cache/snappymail
*.cache-from=type=local,src=${{ runner.temp }}/cache/roundcube
*.cache-from=type=local,src=${{ runner.temp }}/cache/antivirus
*.cache-from=type=local,src=${{ runner.temp }}/cache/fetchmail
*.cache-from=type=local,src=${{ runner.temp }}/cache/resolver
*.cache-from=type=local,src=${{ runner.temp }}/cache/traefik-certdumper
*.cache-from=type=local,src=${{ runner.temp }}/cache/webdav
*.platform=${{ inputs.architecture }}
#This job creates a tagged release. A tag is created for the pinned version x.y.z. The GH release refers to this tag.
#This job creates a tagged release. A tag is created for the pinned version x.y.z. The GH release refers to this tag.
tag-release:
tag-release: