Skip to content

Commit da2bb7a

Browse files
authored
Merge pull request #8 from trustyai-explainability/HFBuild
Add build pipeline for hf detector
2 parents f9bccde + 18053e4 commit da2bb7a

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

.github/workflows/build-and-push-hf.yaml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Push
1+
name: Build and Push - Huggingface Detector
22
on:
33
push:
44
branches:
@@ -61,7 +61,7 @@ jobs:
6161
if: env.BUILD_CONTEXT == 'ci'
6262
run: |
6363
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
6565
- name: Set main-branch environment
6666
if: env.BUILD_CONTEXT == 'main'
6767
run: |
@@ -74,15 +74,11 @@ jobs:
7474
echo "IMAGE_NAME=${{ vars.QUAY_RELEASE_REPO }}" >> $GITHUB_ENV
7575
#
7676
# 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)')
8177
- name: Put expiry date on CI-tagged image
8278
if: env.BUILD_CONTEXT == 'ci'
8379
run: echo 'LABEL quay.expires-after=7d#' >> detectors/Dockerfile.hf
8480
- 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
8682
- name: Log in to Quay
8783
run: docker login -u ${{ secrets.QUAY_ROBOT_USERNAME }} -p ${{ secrets.QUAY_ROBOT_SECRET }} quay.io
8884
- name: Push to Quay CI repo
@@ -103,11 +99,9 @@ jobs:
10399
issue-number: ${{ github.event.pull_request.number }}
104100
edit-mode: replace
105101
body: |
106-
PR image build and manifest generation completed successfully!
102+
PR image build completed successfully!
107103
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 }}`
111105
- name: Trivy scan
112106
uses: aquasecurity/[email protected]
113107
with:

0 commit comments

Comments
 (0)