fix: context

This commit is contained in:
Evans Mike 2023-05-05 12:43:44 +01:00
parent 0cf13cdee1
commit dddb62aae9

View file

@ -41,27 +41,28 @@ jobs:
with:
images: etnperlong/sing-box
- name: Select Dockerfile
id: 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
echo "tagpost=full-distroless" >> $GITHUB_OUTPUT
else
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.full" "$GITHUB_WORKSPACE/Dockerfile"
echo "tag_postfix=full" >> $GITHUB_OUTPUT
echo "tagpost=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
echo "tagpost=mini-distroless" >> $GITHUB_OUTPUT
else
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.minimized" "$GITHUB_WORKSPACE/Dockerfile"
echo "tag_postfix=mini" >> $GITHUB_OUTPUT
echo "tagpost=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
echo "tagpost=distroless" >> $GITHUB_OUTPUT
else
cp "$GITHUB_WORKSPACE/action/dockerfiles/Dockerfile.standard" "$GITHUB_WORKSPACE/Dockerfile"
fi
@ -73,8 +74,8 @@ jobs:
if [[ -z "${{ github.event.inputs.tag }}" ]]; then
echo "versioned=etnperlong/sing-box:${{ github.ref_name }}" >> $GITHUB_OUTPUT
else
if [[ -z "${{ steps.tag.outputs.tag_postfix }}" ]]; then
echo "versioned=etnperlong/sing-box:${{ github.event.inputs.tag }}-${{ steps.tag.outputs.tag_postfix }}" >> $GITHUB_OUTPUT
if [[ -z "${{ steps.dockerfile.outputs.tagpost }}" ]]; then
echo "versioned=etnperlong/sing-box:${{ github.event.inputs.tag }}-${{ steps.dockerfile.outputs.tagpost }}" >> $GITHUB_OUTPUT
else
echo "versioned=etnperlong/sing-box:${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
fi
@ -82,6 +83,7 @@ jobs:
- name: Build and release Docker images
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/386,linux/amd64,linux/arm64,linux/arm/v7,linux/s390x
target: dist
tags: |