Skip to content

Commit

Permalink
Merge pull request #34 from cyber-dojo/add-ci-workflow-image-caching
Browse files Browse the repository at this point in the history
Simplify fingerprint env-var in CI workflow
  • Loading branch information
JonJagger committed May 1, 2024
2 parents 8b4a11d + 676b6c0 commit a5e2ca8
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/main.yml
Expand Up @@ -185,25 +185,22 @@ jobs:
path: ${{ env.IMAGE_TAR_FILENAME }}
key: ${{ env.IMAGE_NAME }}

- name: Make the image digest available to following steps and jobs
id: variables
run: |
DIGEST=$( echo ${{ steps.docker_build.outputs.digest }} | sed 's/.*://')
echo "artifact_digest=${DIGEST}" >> ${GITHUB_OUTPUT}
echo "KOSLI_FINGERPRINT=${DIGEST}" >> ${GITHUB_ENV}
- name: Setup Kosli CLI
uses: kosli-dev/setup-cli-action@v2
with:
version: ${{ vars.KOSLI_CLI_VERSION }}

- name: Attest image evidence to Kosli Trail
env:
KOSLI_FINGERPRINT: ${{ env.KOSLI_FINGERPRINT }}
run:
kosli attest artifact "${IMAGE_NAME}"
id: variables
run: |
DIGEST=$( echo ${{ steps.docker_build.outputs.digest }} | sed 's/.*://')
kosli attest artifact "${IMAGE_NAME}" \
--fingerprint="${DIGEST}" \
--name=saver
echo "artifact_digest=${DIGEST}" >> ${GITHUB_OUTPUT}
unit-tests:
needs: [setup, build-image]
Expand Down

0 comments on commit a5e2ca8

Please sign in to comment.