-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1163 from DFE-Digital/2166-scan-docker-image-in-a…
…ll-repositories Add SNYK scan to build image
- Loading branch information
Showing
3 changed files
with
71 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Build No Cache | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "30 12 * * 0" | ||
# Will run once a week on Sunday afternoon | ||
|
||
jobs: | ||
build-no-cache: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: development | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Checkout | ||
|
||
- uses: azure/login@v2 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
- name: Fetch secrets from key vault | ||
uses: azure/CLI@v2 | ||
id: keyvault-yaml-secret | ||
with: | ||
inlineScript: | | ||
SLACK_WEBHOOK=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.INF_KEY_VAULT }}" --query "value" -o tsv) | ||
echo "::add-mask::$SLACK_WEBHOOK" | ||
echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT | ||
- name: Build without cache and push docker image | ||
id: build-image | ||
uses: DFE-Digital/github-actions/build-docker-image@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
context: . | ||
max-cache: true | ||
reuse-cache: false | ||
snyk-token: ${{ secrets.SNYK_TOKEN }} | ||
|
||
- name: Notify slack on failure | ||
uses: rtCamp/action-slack-notify@master | ||
if: ${{ failure() }} | ||
with: | ||
SLACK_USERNAME: CI Deployment | ||
SLACK_COLOR: failure | ||
SLACK_ICON_EMOJI: ":github-logo:" | ||
SLACK_TITLE: "Build failure" | ||
SLACK_MESSAGE: ":alert: Rebuild docker cache failure :sadparrot:" | ||
SLACK_WEBHOOK: ${{ steps.keyvault-yaml-secret.outputs.SLACK_WEBHOOK }} |