Skip to content

Commit

Permalink
Improve github actions error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienPatte committed Dec 16, 2024
1 parent e115f31 commit 886225a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/scripts/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ VERSION=${VERSION#v}

echo "Version $VERSION"
if [[ -z $VERSION ]]; then
echo "Failed to retrieve latest version for $IMAGE"
echo "::error::Failed to retrieve latest version for $IMAGE"
exit 1
else
set +e
docker buildx build \
--platform linux/amd64,linux/arm64 \
--provenance=false \
Expand All @@ -40,5 +42,11 @@ else
--annotation "index:org.opencontainers.image.description=${DESCRIPTION}" \
--output "type=registry,name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/${IMAGE}:${VERSION},rewrite-timestamp=true" \
--output "type=registry,name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/${IMAGE}:latest,rewrite-timestamp=true" \
- < images/${IMAGE}/Dockerfile
- < images/${IMAGE}/Dockerfile \
2> >(tee err)
if [[ $? -ne 0 ]]; then
echo "::error::$IMAGE image build failed with error: $(cat err | grep '^ERROR')"
exit 1
fi
set -e
fi
1 change: 1 addition & 0 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- test
schedule:
- cron: '0 0 * * *'

Expand Down
1 change: 1 addition & 0 deletions images/jellyfin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN \
git \
# Needed to get the jellyfin-ffmpeg version \
jq \
make-it-fail \
&& curl \
--location \
https://github.com/canonical/chisel/releases/download/${CHISEL_VERSION}/chisel_${CHISEL_VERSION}_linux_${TARGETARCH}.tar.gz \
Expand Down

0 comments on commit 886225a

Please sign in to comment.