mirror of
https://github.com/jkaninda/laravel-php-fpm.git
synced 2025-12-06 17:09:39 +01:00
Add tag based on folder
This commit is contained in:
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
@@ -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}}"
|
||||
Reference in New Issue
Block a user