name: docker-release on: push: branches: - stable - develop tags: - '*' jobs: docker-build-push: runs-on: ubuntu-22.04 steps: - name: Checkout Code uses: actions/checkout@v3 with: fetch-depth: 0 # # only needed for arm64 builds # - name: Set up QEMU # uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to docker.io container registry uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Login to Quay.io uses: docker/login-action@v2 with: registry: quay.io username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_ROBOT_TOKEN }} - name: Get version tag in the old way run: echo ZAMMAD_VERSION="$(git describe --tags | sed -e 's/-[a-z0-9]\{8,\}.*//g')" >> $GITHUB_ENV - name: Docker metadata action id: meta uses: docker/metadata-action@v4 with: images: | ghcr.io/${{ github.repository_owner }}/zammad index.docker.io/${{ github.repository_owner }}/zammad index.docker.io/${{ github.repository_owner }}/zammad-docker-compose quay.io/${{ github.repository_owner }}/zammad tags: | type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'stable') }} type=raw,value=${{ env.ZAMMAD_VERSION }},enable=${{ github.ref == format('refs/heads/{0}', 'stable') }} type=raw,value=zammad-${{ env.ZAMMAD_VERSION }},enable=${{ github.ref == format('refs/heads/{0}', 'stable') }} type=ref,event=branch type=ref,event=tag type=semver,pattern={{major}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{version}} type=sha - name: Build and push id: docker_build uses: docker/build-push-action@v4 with: context: . labels: ${{ steps.meta.outputs.labels }} # arm64 build takes up to 4 hours platforms: linux/amd64 #,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }}