fix: why?

This commit is contained in:
Evans Mike 2023-05-05 12:39:27 +01:00
parent 5bbcc1d4ef
commit 0cf13cdee1

View file

@ -30,32 +30,6 @@ jobs:
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
- name: Setup QEMU for Docker Buildx - name: Setup QEMU for Docker Buildx
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2
- name: Select Dockerfile
run: |
if [[ "${{ matrix.buildType }}" == "full" ]]; then
if [[ "${{ matrix.distro }}" == "distroless" ]]; then
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.distroless.full" Dockerfile
echo "tag_postfix=full-distroless" >> $GITHUB_OUTPUT
else
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.full" Dockerfile
echo "tag_postfix=full" >> $GITHUB_OUTPUT
fi
elif [[ "${{ matrix.buildType }}" == "minimized" ]]; then
if [[ "${{ matrix.distro }}" == "distroless" ]]; then
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.distroless.minimized" Dockerfile
echo "tag_postfix=mini-distroless" >> $GITHUB_OUTPUT
else
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.minimized" Dockerfile
echo "tag_postfix=mini" >> $GITHUB_OUTPUT
fi
else
if [[ "${{ matrix.distro }}" == "distroless" ]]; then
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.distroless.standard" Dockerfile
echo "tag_postfix=distroless" >> $GITHUB_OUTPUT
else
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.standard" Dockerfile
fi
fi
- name: Login to Docker Hub Container Registry - name: Login to Docker Hub Container Registry
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
@ -66,6 +40,32 @@ jobs:
uses: docker/metadata-action@v4 uses: docker/metadata-action@v4
with: with:
images: etnperlong/sing-box images: etnperlong/sing-box
- name: Select Dockerfile
run: |
if [[ "${{ matrix.buildType }}" == "full" ]]; then
if [[ "${{ matrix.distro }}" == "distroless" ]]; then
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.distroless.full" "$GITHUB_WORKSPACE/Dockerfile"
echo "tag_postfix=full-distroless" >> $GITHUB_OUTPUT
else
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.full" "$GITHUB_WORKSPACE/Dockerfile"
echo "tag_postfix=full" >> $GITHUB_OUTPUT
fi
elif [[ "${{ matrix.buildType }}" == "minimized" ]]; then
if [[ "${{ matrix.distro }}" == "distroless" ]]; then
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.distroless.minimized" "$GITHUB_WORKSPACE/Dockerfile"
echo "tag_postfix=mini-distroless" >> $GITHUB_OUTPUT
else
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.minimized" "$GITHUB_WORKSPACE/Dockerfile"
echo "tag_postfix=mini" >> $GITHUB_OUTPUT
fi
else
if [[ "${{ matrix.distro }}" == "distroless" ]]; then
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.distroless.standard" "$GITHUB_WORKSPACE/Dockerfile"
echo "tag_postfix=distroless" >> $GITHUB_OUTPUT
else
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.standard" "$GITHUB_WORKSPACE/Dockerfile"
fi
fi
- name: Get tag to build - name: Get tag to build
id: tag id: tag
run: | run: |