Skip to content

Commit

Permalink
build: use newly added org.opencontainers.image.base.digest for SHA25…
Browse files Browse the repository at this point in the history
…6 comparison
  • Loading branch information
yacoob committed Nov 14, 2024
1 parent 389a3cb commit 25b0b4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,7 @@ jobs:
matrix:
recipe:
- recipe.yml
env:
SHA_FILE: latest_base_image_sha
steps:
- name: Get SHA of the latest base image
run: |
F=${RUNNER_TEMP}/${SHA_FILE}
skopeo inspect --format '{{ .Digest }}' docker://ghcr.io/ublue-os/aurora-dx:stable > $F
echo "Attempting the build at: $(cat $F) (modulo a race condition 8)"
- name: Build Custom Image
uses: blue-build/github-action@v1
with:
Expand All @@ -40,9 +33,3 @@ jobs:
pr_event_number: ${{ github.event.number }}
maximize_build_space: false
use_unstable_cli: true
- name: Save SHA of the current base image as an artifact
uses: actions/upload-artifact@v4
with:
path: ${{ runner.temp }}/${{ env.SHA_FILE }}
name: latest_base_image_sha
retention-days: 90
15 changes: 2 additions & 13 deletions .github/workflows/maybe_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,13 @@ jobs:
- name: Get SHA of the latest base image present in the repository
id: registry
run: |
REGISTRY_SHA=$(skopeo inspect --format '{{ .Digest }}' docker://ghcr.io/ublue-os/aurora-dx:stable )
REGISTRY_SHA=$(skopeo inspect docker://ghcr.io/ublue-os/aurora-dx:stable | jq '.Digest' )
echo "SHA=$REGISTRY_SHA" >> $GITHUB_OUTPUT
- name: Download artifact from the last successful build
id: last-artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: build.yaml
workflow_search: false
workflow_conclusion: success
name: latest_base_image_sha
if_no_artifact_found: ignore

- name: Get SHA of the base image from the last successful build
id: last-build
if: steps.last-artifact.outputs.found_artifact == 'true'
run: |
LAST_BUILD_SHA=$(cat latest_base_image_sha)
LAST_BUILD_SHA=$(skopeo inspect docker://ghcr.io/yacoob/yaurora:latest | jq '.Labels."org.opencontainers.image.base.digest"')
echo "SHA=$LAST_BUILD_SHA" >> $GITHUB_OUTPUT
- name: Output gathered information
Expand Down

0 comments on commit 25b0b4d

Please sign in to comment.