added registry imagename to registry
This commit is contained in:
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
@@ -192,7 +192,6 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Login to Docker Registry
|
- name: Login to Docker Registry
|
||||||
if: ${{ env.REGISTRY != '' }}
|
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
@@ -203,13 +202,13 @@ jobs:
|
|||||||
id: meta
|
id: meta
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.ref_type }}" = "tag" ]; then
|
if [ "${{ github.ref_type }}" = "tag" ]; then
|
||||||
echo "tags=${{ env.IMAGE_NAME }}:${{ github.ref_name }},${{ env.IMAGE_NAME }}:latest" >> $GITHUB_OUTPUT
|
echo "tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_OUTPUT
|
||||||
elif [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
elif [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
||||||
echo "tags=${{ env.IMAGE_NAME }}:latest,${{ env.IMAGE_NAME }}:$(date +%Y%m%d)" >> $GITHUB_OUTPUT
|
echo "tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$(date +%Y%m%d)" >> $GITHUB_OUTPUT
|
||||||
elif [ "${{ github.ref }}" = "refs/heads/development" ]; then
|
elif [ "${{ github.ref }}" = "refs/heads/development" ]; then
|
||||||
echo "tags=${{ env.IMAGE_NAME }}:development,${{ env.IMAGE_NAME }}:$(date +%Y%m%d)" >> $GITHUB_OUTPUT
|
echo "tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:development,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$(date +%Y%m%d)" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "tags=${{ env.IMAGE_NAME }}:pr-$(echo ${{ github.ref }} | sed 's/refs\/heads\///' | tr '/' '-')" >> $GITHUB_OUTPUT
|
echo "tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-$(echo ${{ github.ref }} | sed 's/refs\/heads\///' | tr '/' '-')" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
@@ -221,8 +220,7 @@ jobs:
|
|||||||
build-args: |
|
build-args: |
|
||||||
BINARY_NAME=${{ needs.detect-project.outputs.project-name }}
|
BINARY_NAME=${{ needs.detect-project.outputs.project-name }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
push: ${{ env.REGISTRY != '' }}
|
push: true
|
||||||
load: ${{ env.REGISTRY == '' }}
|
|
||||||
|
|
||||||
summary:
|
summary:
|
||||||
name: Workflow Summary
|
name: Workflow Summary
|
||||||
|
Reference in New Issue
Block a user