github: push a :latest-v1 tag

This commit is contained in:
Valentin Tolmer 2022-11-21 12:10:47 +01:00
parent 586e8df29d
commit 4eb54d58a1

View File

@ -4,6 +4,7 @@ on:
push: push:
branches: branches:
- 'main' - 'main'
- 'v1'
release: release:
types: types:
- 'published' - 'published'
@ -347,6 +348,11 @@ jobs:
###################### ######################
#### latest build #### #### latest build ####
###################### ######################
- name: Sets env vars for docker images
run: |
echo "DOCKER_IMAGE_SUFFIX=-v1" >> $GITHUB_ENV
if: github.ref == 'refs/heads/v1'
- name: Build and push latest alpine - name: Build and push latest alpine
if: github.event_name != 'release' if: github.event_name != 'release'
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
@ -355,7 +361,7 @@ jobs:
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
file: ./.github/workflows/Dockerfile.ci.alpine file: ./.github/workflows/Dockerfile.ci.alpine
tags: nitnelave/lldap:latest, nitnelave/lldap:latest-alpine tags: nitnelave/lldap:latest${{env.DOCKER_IMAGE_SUFFIX}}, nitnelave/lldap:latest-alpine${{env.DOCKER_IMAGE_SUFFIX}}
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new cache-to: type=local,dest=/tmp/.buildx-cache-new
@ -367,7 +373,7 @@ jobs:
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v7
file: ./.github/workflows/Dockerfile.ci.debian file: ./.github/workflows/Dockerfile.ci.debian
tags: nitnelave/lldap:latest-debian tags: nitnelave/lldap:latest-debian${{env.DOCKER_IMAGE_SUFFIX}}
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new cache-to: type=local,dest=/tmp/.buildx-cache-new
@ -375,7 +381,7 @@ jobs:
#### release build #### #### release build ####
####################### #######################
- name: Build and push release alpine - name: Build and push release alpine
if: github.event_name == 'release' if: github.event_name == 'release' && github.ref != 'refs/heads/v1'
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
context: . context: .
@ -482,4 +488,4 @@ jobs:
bin/amd64-bin/migration-tool-amd64, bin/amd64-bin/migration-tool-amd64,
web.zip" web.zip"
env: env:
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ github.token }}