1
- name : Build and Push
1
+ name : Build and Push - Huggingface Detector
2
2
on :
3
3
push :
4
4
branches :
61
61
if : env.BUILD_CONTEXT == 'ci'
62
62
run : |
63
63
echo "TAG=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
64
- echo "IMAGE_NAME=quay.io/trustyai/trustyai-service -ci" >> $GITHUB_ENV
64
+ echo "IMAGE_NAME=quay.io/trustyai/guardrails-detector-huggingface-runtime -ci" >> $GITHUB_ENV
65
65
- name : Set main-branch environment
66
66
if : env.BUILD_CONTEXT == 'main'
67
67
run : |
@@ -74,15 +74,11 @@ jobs:
74
74
echo "IMAGE_NAME=${{ vars.QUAY_RELEASE_REPO }}" >> $GITHUB_ENV
75
75
#
76
76
# Run docker commands
77
- - name : Pull prerequisite images
78
- run : |
79
- docker pull $(cat detectors/Dockerfile.hf | grep -o -P '(?<=FROM ).*(?= AS base)')
80
- docker pull $(cat detectors/Dockerfile.hf | grep -o -P '(?<=FROM ).*(?= AS builder)')
81
77
- name : Put expiry date on CI-tagged image
82
78
if : env.BUILD_CONTEXT == 'ci'
83
79
run : echo 'LABEL quay.expires-after=7d#' >> detectors/Dockerfile.hf
84
80
- name : Build image
85
- run : cd detectors; docker build -t ${{ env.IMAGE_NAME }}:$TAG Dockerfile.hf
81
+ run : docker build -t ${{ env.IMAGE_NAME }}:$TAG -f detectors/ Dockerfile.hf detectors
86
82
- name : Log in to Quay
87
83
run : docker login -u ${{ secrets.QUAY_ROBOT_USERNAME }} -p ${{ secrets.QUAY_ROBOT_SECRET }} quay.io
88
84
- name : Push to Quay CI repo
@@ -103,11 +99,9 @@ jobs:
103
99
issue-number : ${{ github.event.pull_request.number }}
104
100
edit-mode : replace
105
101
body : |
106
- PR image build and manifest generation completed successfully!
102
+ PR image build completed successfully!
107
103
108
- 📦 [PR image](quay.io/trustyai/guardrails-detector-huggingface-runtime-ci:${{ github.event.pull_request.head.sha }}): `quay.io/trustyai/guardrails-detector-huggingface-runtime-ci:${{ github.event.pull_request.head.sha }}`
109
-
110
- ```
104
+ 📦 [PR image](https://quay.io/repository/trustyai/guardrails-detector-huggingface-runtime-ci?tab=tags): `quay.io/trustyai/guardrails-detector-huggingface-runtime-ci:${{ github.event.pull_request.head.sha }}`
111
105
- name : Trivy scan
112
106
uses :
aquasecurity/[email protected]
113
107
with :
0 commit comments