@ -1,3 +1,11 @@
###############################################
# REQUIRED secrets
# ${{ secrets.Docker_Login }}
# Username of docker login for logging in docker for pulling images (higher pull rate limit)
# ${{ secrets.Docker_Password }}
# Password of docker login for logging in docker for pulling images (higher pull rate limit)
################################################
name : build-test-deploy
name : build-test-deploy
on :
on :
workflow_call:
workflow_call:
@ -16,7 +24,7 @@ on:
required : true
required : true
type : string
type : string
docker_org:
docker_org:
description : 'The docker organisation where the images are pushed to. '
description : 'The docker organisation where the images are pushed to. E.g. ghcr.io/mailu '
required : true
required : true
type : string
type : string
branch:
branch:
@ -24,7 +32,7 @@ on:
required : true
required : true
type : string
type : string
deploy:
deploy:
description : Deploy to docker hub . Happens for all branches but staging. Use string true or false.
description : Deploy to container registry . Happens for all branches but staging. Use string true or false.
default : true
default : true
required : false
required : false
type : string
type : string
@ -50,7 +58,7 @@ on:
required : true
required : true
type : string
type : string
docker_org:
docker_org:
description : 'The docker organisation where the images are pushed to. '
description : 'The docker organisation where the images are pushed to. E.g. ghcr.io/mailu '
required : true
required : true
type : string
type : string
branch:
branch:
@ -58,7 +66,7 @@ on:
required : true
required : true
type : string
type : string
deploy:
deploy:
description : Deploy to docker hub . Happens for all branches but staging. Use string true or false.
description : Deploy to container registry . Happens for all branches but staging. Use string true or false.
default : true
default : true
required : false
required : false
type : string
type : string
@ -250,8 +258,8 @@ jobs:
- name : Build all docker images
- name : Build all docker images
env:
env:
DOCKER_ORG : ghcr.io/${{ steps.string.outputs.lowercase }}
DOCKER_ORG : ghcr.io/${{ steps.string.outputs.lowercase }}
MAILU_VERSION : ${{ env.MAILU_VERSION }}
MAILU_VERSION : ${{ env.MAILU_VERSION }} -build
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }} -build
uses : docker/bake-action@v2
uses : docker/bake-action@v2
with:
with:
files : ${{env.HCL_FILE}}
files : ${{env.HCL_FILE}}
@ -313,8 +321,8 @@ jobs:
- name : Build all docker images
- name : Build all docker images
env:
env:
DOCKER_ORG : ghcr.io/${{ steps.string.outputs.lowercase }}
DOCKER_ORG : ghcr.io/${{ steps.string.outputs.lowercase }}
MAILU_VERSION : ${{ env.MAILU_VERSION }}
MAILU_VERSION : ${{ env.MAILU_VERSION }} -build
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }} -build
uses : docker/bake-action@v2
uses : docker/bake-action@v2
with:
with:
files : ${{env.HCL_FILE}}
files : ${{env.HCL_FILE}}
@ -381,8 +389,8 @@ jobs:
run : python tests/compose/test.py ${{ matrix.target }} ${{ matrix.time }}
run : python tests/compose/test.py ${{ matrix.target }} ${{ matrix.time }}
env:
env:
DOCKER_ORG : ghcr.io/${{ steps.string.outputs.lowercase }}
DOCKER_ORG : ghcr.io/${{ steps.string.outputs.lowercase }}
MAILU_VERSION : ${{ env.MAILU_VERSION }}
MAILU_VERSION : ${{ env.MAILU_VERSION }} -build
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }}
PINNED_MAILU_VERSION : ${{ env.PINNED_MAILU_VERSION }} -build
deploy:
deploy:
name : Deploy images
name : Deploy images
@ -409,17 +417,18 @@ jobs:
- 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
- name : Helper to convert docker org to lowercase
id : string
id : string
uses : ASzc/change-string-case-action@v5
uses : ASzc/change-string-case-action@v5
with:
with:
string : ${{ github.repository_owner }}
string : ${{ github.repository_owner }}
- name : Push image to Docker
- name : Push image to Github (ghcr.io)
shell : bash
shell : bash
run : |
run : |
if [ '${{ env.MAILU_VERSION }}' == 'master' ]; then pinned_mailu_version='master'; else pinned_mailu_version=${{ env.PINNED_MAILU_VERSION}}; fi;
if [ '${{ env.MAILU_VERSION }}' == 'master' ]; then pinned_mailu_version='master'; else pinned_mailu_version=${{ env.PINNED_MAILU_VERSION}}; fi;
@ -427,7 +436,7 @@ jobs:
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:${{ env.MAILU_VERSION }} \
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:${{ env.MAILU_VERSION }} \
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:$pinned_mailu_version \
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:$pinned_mailu_version \
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:latest \
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:latest \
ghcr.io/${{ steps.string.outputs.lowercase }}/${{ matrix.target }}:${{ env.MAILU_VERSION }}
ghcr.io/${{ steps.string.outputs.lowercase }}/${{ matrix.target }}:${{ env.MAILU_VERSION }} -build
deploy-arm:
deploy-arm:
name : Deploy images for arm
name : Deploy images for arm
@ -454,17 +463,18 @@ jobs:
- 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
- name : Helper to convert docker org to lowercase
id : string
id : string
uses : ASzc/change-string-case-action@v5
uses : ASzc/change-string-case-action@v5
with:
with:
string : ${{ github.repository_owner }}
string : ${{ github.repository_owner }}
- name : Push image to Docker
- name : Push image to Github (ghcr.io)
shell : bash
shell : bash
run : |
run : |
if [ '${{ env.MAILU_VERSION }}' == 'master-arm' ]; then pinned_mailu_version='master-arm'; else pinned_mailu_version=${{ env.PINNED_MAILU_VERSION}}; fi;
if [ '${{ env.MAILU_VERSION }}' == 'master-arm' ]; then pinned_mailu_version='master-arm'; else pinned_mailu_version=${{ env.PINNED_MAILU_VERSION}}; fi;
@ -472,7 +482,7 @@ jobs:
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:${{ env.MAILU_VERSION }} \
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:${{ env.MAILU_VERSION }} \
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:$pinned_mailu_version \
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:$pinned_mailu_version \
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:latest \
--tag ${{ inputs.docker_org }}/${{ matrix.target }}:latest \
ghcr.io/${{ steps.string.outputs.lowercase }}/${{ matrix.target }}:${{ env.MAILU_VERSION }}
ghcr.io/${{ steps.string.outputs.lowercase }}/${{ matrix.target }}:${{ env.MAILU_VERSION }} -build
#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: