-
Notifications
You must be signed in to change notification settings - Fork 304
48 lines (38 loc) · 1.57 KB
/
docker-release-publish.yml
File metadata and controls
48 lines (38 loc) · 1.57 KB
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
name: Build and Push Docker Image
on:
create:
branches:
- release/*
jobs:
build:
runs-on: linux-large-disk
steps:
- name: Checkout code
uses: actions/checkout@v4
# Extract branch name after "release/"
- name: Extract branch name
id: extract_branch
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/release/}
echo "SHORT_BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
# Set up QEMU emulation for arm64
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# Set up Docker Buildx, useful for building multi-platform images
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Login to NGC
- name: Log in to NGC Registry
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login nvcr.io --username "\$oauthtoken" --password-stdin
- name: Create HF token file
run: |
mkdir -p ./scripts/private_local
echo "${{ secrets.HF_ACCESS_TOKEN }}" > ./scripts/private_local/hf_token.txt
# Build the Docker image using the Dockerfile
- name: Build Docker image
run: |
docker buildx create --use
docker buildx build --platform linux/amd64 --push --target runtime --build-arg GIT_COMMIT=${GITHUB_SHA} --build-arg DOWNLOAD_LLAMA_TOKENIZER=True --secret id=hf_token,src=./scripts/private_local/hf_token.txt -t ${{ secrets.DOCKER_REGISTRY }}/nv-ingest:${{ env.SHORT_BRANCH_NAME }} .
- name: Cleanup HF token file
if: always()
run: rm -f ./scripts/private_local/hf_token.txt