π A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Vue awesomedashboarddockerhomelabhomepagemitnodejsorganizationproductivitypwaself-hostedstartpagevue
π Updated Docker workflow actions, improves summary
Alicia Sykes567517b3e41f
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.ymlindex cad595d5..01837bc4 100644--- a/.github/workflows/docker.yml+++ b/.github/workflows/docker.yml@@ -34,7 +34,7 @@ permissions:contents: readenv:- DH_IMAGE: ${{ secrets.DOCKER_REPO }}+ DH_IMAGE: ${{ vars.DOCKER_REPO || 'lissy93/dashy' }}GH_IMAGE: ghcr.io/${{ github.repository }}jobs:@@ -45,6 +45,9 @@ jobs:contents: readpackages: writesecurity-events: write+ env:+ DOCKER_BUILD_SUMMARY: "false"+ DOCKER_BUILD_RECORD_UPLOAD: "false"strategy:fail-fast: falsematrix:@@ -135,7 +138,7 @@ jobs:- name: π€ Upload Trivy SARIFif: always() && hashFiles(format('trivy-{0}.sarif', matrix.arch)) != ''- uses: github/codeql-action/upload-sarif@v3+ uses: github/codeql-action/upload-sarif@v4with:sarif_file: trivy-${{ matrix.arch }}.sarifcategory: trivy-${{ matrix.arch }}@@ -179,7 +182,7 @@ jobs:id-token: writeattestations: writeenv:- HAS_DH: ${{ secrets.DOCKER_USERNAME != '' && secrets.DOCKER_PASSWORD != '' && secrets.DOCKER_REPO != '' }}+ HAS_DH: ${{ secrets.DOCKER_USERNAME != '' && secrets.DOCKER_PASSWORD != '' }}SEMVER_VALUE: ${{ inputs.tag || github.ref_name }}SEMVER_ENABLE: ${{ github.event_name == 'push' || inputs.tag != '' }}LATEST_ENABLE: ${{ inputs.tag == '' }}@@ -235,8 +238,8 @@ jobs:for f in *; do SOURCES+=("${GH_IMAGE}@$(cat "$f")"); donedocker buildx imagetools create "${TAGS[@]}" "${SOURCES[@]}"PRIMARY=$(jq -r --arg img "$GH_IMAGE" \- '.tags[] | select(startswith($img + ":"))' \- <<< "$DOCKER_METADATA_OUTPUT_JSON" | head -1)+ '[.tags[] | select(startswith($img + ":"))] | first // empty' \+ <<< "$DOCKER_METADATA_OUTPUT_JSON")DIGEST=$(docker buildx imagetools inspect "$PRIMARY" --format '{{.Manifest.Digest}}')echo "primary_tag=$PRIMARY" >> "$GITHUB_OUTPUT"echo "digest=$DIGEST" >> "$GITHUB_OUTPUT"@@ -251,7 +254,7 @@ jobs:- name: πͺͺ Attest SBOMid: attest_sbom- uses: actions/attest-sbom@v4+ uses: actions/attest@v4continue-on-error: truewith:subject-name: ${{ env.GH_IMAGE }}@@ -276,30 +279,68 @@ jobs:PROV_OUTCOME: ${{ steps.attest_provenance.outcome }}PROV_URL: ${{ steps.attest_provenance.outputs.attestation-url }}DIGEST: ${{ steps.manifest.outputs.digest }}+ PRIMARY: ${{ steps.manifest.outputs.primary_tag }}TAGS_JSON: ${{ steps.meta.outputs.json }}+ DIGESTS_DIR: ${{ runner.temp }}/digestsrun: |+ # Behold, some ugly bash, to produce a pretty output (don't read it, just trust)set -euo pipefail- attest() {- case "$2" in++ attest_line() {+ local label="$1" outcome="$2" url="$3"+ case "$outcome" insuccess)- if [ -n "$3" ]; then- echo "- β $1 attested ([view]($3))"+ if [ -n "$url" ]; then+ echo "- β $label attested ([view]($url))"else- echo "- β $1 attested"+ echo "- β $label attested"fi ;;- failure) echo "- β οΈ $1 attestation failed (image pushed without attest)" ;;- *) echo "- βοΈ $1 attestation \`$2\`" ;;+ failure) echo "- β οΈ $label attestation failed (image pushed without attest)" ;;+ *) echo "- βοΈ $label attestation \`$outcome\`" ;;esac}++ arch_section() {+ local arch="$1" file="$DIGESTS_DIR/$arch"+ [ -f "$file" ] || return 0+ local digest manifest size count+ digest=$(cat "$file")+ manifest=$(docker buildx imagetools inspect "${PRIMARY%%:*}@$digest" --raw 2>/dev/null || echo '{}')+ size=$(jq '[.layers[]?.size // 0] | add // 0' <<< "$manifest")+ count=$(jq '.layers // [] | length' <<< "$manifest")+ echo "#### Dashy \`$arch\`"+ echo ""+ echo "- **Digest:** \`$digest\`"+ [ "$size" != "0" ] && echo "- **Size:** $(numfmt --to=iec --suffix=B "$size" 2>/dev/null || echo "$size B")"+ [ "$count" != "0" ] && echo "- **Layers:** $count"+ echo ""+ }++ # Clear auto-generated "Attestation Created" blocks from attest actions.+ : > "$GITHUB_STEP_SUMMARY"{if [ -n "$DIGEST" ]; then- echo "## π³ Docker Image"+ echo "## Docker Image"+ echo ""echo "**Manifest:** \`$DIGEST\`"+ echo ""echo '```bash'jq -r '.tags[] | "docker pull \(.)"' <<< "$TAGS_JSON"echo '```'+ echo ""+ echo "---"+ echo ""fi- echo "## πͺͺ Attestations"- attest "SBOM" "$SBOM_OUTCOME" "$SBOM_URL"- attest "Build provenance" "$PROV_OUTCOME" "$PROV_URL"+ echo "## Attestations"+ echo ""+ attest_line "SBOM" "$SBOM_OUTCOME" "$SBOM_URL"+ attest_line "Build provenance" "$PROV_OUTCOME" "$PROV_URL"+ echo ""+ echo "---"+ echo ""+ echo "## Build Info"+ echo ""+ for arch in amd64 arm64 armv7; do+ arch_section "$arch"+ done} >> "$GITHUB_STEP_SUMMARY"