Add tag based on folder

This commit is contained in:
2022-12-05 13:41:51 +02:00
parent 852421b134
commit 09f0c4c2e0
7 changed files with 388 additions and 10 deletions

View File

@@ -1,9 +1,14 @@
name: Docker image build and Push Image to registry
on:
push:
branches:
- '**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
docker_tag:
description: 'Docker tag'
required: true
default: 'latest'
type: string
env:
#BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
@@ -16,12 +21,11 @@ jobs:
name: Set environment for branch
run: |
set -x
if [[ $GITHUB_REF == 'refs/heads/master' ]]; then
echo "TAG_NAME=latest" >> "$GITHUB_ENV"
echo "runs-on: master branch"
if [[ ${{ inputs.docker_tag }} == 'latest' ]]; then
TAG_NAME=8.1
echo "Build latest tag'"
else
echo "TAG_NAME=${{ github.head_ref || github.ref_name }}" >> "$GITHUB_ENV"
echo "runs-on: ${{ github.head_ref || github.ref_name }} branch"
TAG_NAME=${{ inputs.docker_tag }}
fi
-
name: Set up QEMU
@@ -39,5 +43,7 @@ jobs:
name: Build and push
uses: docker/build-push-action@v3
with:
context: ./
file: "./docker/${{TAG_NAME}}/Dockerfile"
push: true
tags: "${{env.BUILDKIT_IMAGE}}:${{env.TAG_NAME}}"