This commit is contained in:
@@ -1,20 +0,0 @@
|
|||||||
name: Build docker image
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
branch_name:
|
|
||||||
description: 'Branch name that can be used as docker image tag'
|
|
||||||
value: ${{ steps.build.outputs.branch_name }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Create tag name
|
|
||||||
run: |
|
|
||||||
BRANCH_NAME="${{ github.ref }}"
|
|
||||||
CLEAN_BRANCH=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9._-]/-/g' | tr '[:upper:]' '[:lower:]')
|
|
||||||
|
|
||||||
- name: Set output
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "branch_name=$CLEAN_BRANCH" >> $GITHUB_OUTPUT
|
|
||||||
23
.gitea/actions/getTagSafeRef/action.yml
Normal file
23
.gitea/actions/getTagSafeRef/action.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: 'Get Tag Safe Branch Name'
|
||||||
|
description: 'Get a sanitized branch name that can be used as a Docker tag'
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
branch_name:
|
||||||
|
description: 'Branch name that can be used as docker image tag'
|
||||||
|
value: ${{ steps.get-branch.outputs.branch_name }}
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: Create tag safe branch name
|
||||||
|
id: get-branch
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
BRANCH_NAME="${{ github.ref }}"
|
||||||
|
|
||||||
|
# Clean the branch name for Docker tag compatibility
|
||||||
|
CLEAN_BRANCH=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9._-]/-/g' | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
|
echo "Original branch: $BRANCH_NAME"
|
||||||
|
echo "Clean branch: $CLEAN_BRANCH"
|
||||||
|
echo "branch_name=$CLEAN_BRANCH" >> $GITHUB_OUTPUT
|
||||||
@@ -12,10 +12,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Get tag safe branch name
|
- name: Get tag safe branch name
|
||||||
id: branch_name
|
id: branch_name
|
||||||
uses: .gitea/actions/getTagSafeRef.yml
|
uses: .gitea/actions/getTagSafeRef
|
||||||
|
|
||||||
- name: Print branch_name
|
- name: Print branch_name
|
||||||
run: ${{ steps.branch_name.outputs.branch_name }}
|
run: echo "${{ steps.branch_name.outputs.branch_name }}"
|
||||||
|
|
||||||
# - name: Build and push image
|
# - name: Build and push image
|
||||||
# id: docker_build
|
# id: docker_build
|
||||||
|
|||||||
Reference in New Issue
Block a user