Skip to content

Commit

Permalink
Fix CI/CD Docker Builder Failing
Browse files Browse the repository at this point in the history
- [+] feat(Docker.yml): add input for manual trigger with tag name
- [+] fix(Docker.yml): improve tag name determination logic
  • Loading branch information
H0llyW00dzZ committed Feb 5, 2024
1 parent d742d4a commit 0cc5ab3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/Docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag_name:
description: 'Tag Name (Optional for manual trigger)'
required: false
default: ''

jobs:
build-and-push:
Expand All @@ -28,9 +33,17 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Extract tag name
- name: Determine Tag Name
id: tag_name
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ "${{ github.event.inputs.tag_name }}" != "" ]; then
echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
elif [ "${GITHUB_REF#refs/tags/}" != "" ]; then
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
else
echo "Error: Tag name not provided."
exit 1
fi
- name: Build and Push Docker image
uses: docker/build-push-action@v3
Expand Down

0 comments on commit 0cc5ab3

Please sign in to comment.