Skip to content

Streamline vulnerability scan workflow to build docker image once#921

Closed
lisac wants to merge 2 commits intomainfrom
lisac/ci-vulnerability-scans-build-image-once
Closed

Streamline vulnerability scan workflow to build docker image once#921
lisac wants to merge 2 commits intomainfrom
lisac/ci-vulnerability-scans-build-image-once

Conversation

@lisac
Copy link
Copy Markdown
Contributor

@lisac lisac commented Apr 16, 2025

Ticket

Implements a proposed improvement documented in workflow vulnerability-scans.yml:

NOTE: The workflow isn't able to pass the docker image between jobs, so each builds the image.
A future PR will pass the image between the scans to reduce overhead and increase speed

Changes

Refactors creation of the app's docker image in the vulnerability-scans.yml workflow:

  • new job: build-and-cache: builds the image and puts it in a cache
  • updates other jobs to use the cached image, instead of building the image as part of the job

Context for reviewers

This is taken from the implementation in HHS/simpler-grants-gov: https://github.com/HHS/simpler-grants-gov/blob/6dadc31f8474c386b824654d3ce2bb428bec584f/.github/workflows/vulnerability-scans.yml , which was authored by @daphnegold (thank you!).
Minor adjustment to use ubuntu-latest.

Testing

navapbc/platform-test#196

@lisac lisac self-assigned this Apr 16, 2025
@lisac lisac requested a review from lorenyu April 16, 2025 21:59
@lisac
Copy link
Copy Markdown
Contributor Author

lisac commented Apr 17, 2025

not ready for review

@lisac lisac closed this Apr 17, 2025
@lisac lisac deleted the lisac/ci-vulnerability-scans-build-image-once branch October 8, 2025 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants