forked from opea-project/GenAIComps
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (49 loc) · 1.68 KB
/
container-build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: Container Build
permissions: read-all
on:
workflow_dispatch:
schedule:
- cron: "35 1 * * 6"
jobs:
# https://github.com/intel/ai-containers/blob/main/.github/action.yml
build-containers:
runs-on: docker
env:
REGISTRY: ${{ secrets.REGISTRY }}
REPO: ${{ secrets.REPO }}
steps:
- uses: step-security/harden-runner@v2
with:
egress-policy: audit
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
path: tei-gaudi
ref: habana-main
repository: huggingface/tei-gaudi
token: ${{ secrets.ACTION_TOKEN }}
- uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build Containers
run: |
docker compose -p ${GITHUB_RUN_NUMBER} build --no-cache
working-directory: .github/workflows/docker
- name: Print Containers to Summary
run: |
docker compose -p ${GITHUB_RUN_NUMBER} images --format json | jq -r --arg registry "$REGISTRY" '.[] | select(.Repository | contains($registry)) | .Tag' >> $GITHUB_STEP_SUMMARY
- name: Push Containers
run: |
docker compose -p ${GITHUB_RUN_NUMBER} push
working-directory: .github/workflows/docker
- name: Un-Tag Containers
run: |
docker compose -p ${GITHUB_RUN_NUMBER} down --rmi all
working-directory: .github/workflows/docker
- name: Remove Containers
if: always()
run: docker system prune --all --force