Skip to content

Commit

Permalink
trying to automate the build
Browse files Browse the repository at this point in the history
  • Loading branch information
ctr26 committed Feb 21, 2024
1 parent b41b057 commit 07bccbe
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 33 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Manually Triggered Build and Push

on:
workflow_dispatch:
inputs:
baseImage:
description: 'Base image (e.g., nvcr.io/nvidia/tritonserver)'
required: true
default: 'nvcr.io/nvidia/tritonserver'
baseTag:
description: 'Base image tag (e.g., 24.01-py3-igpu)'
required: true
default: '24.01-py3-igpu'

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/tritonserver-custom:${{ github.event.inputs.baseTag }}
build-args: |
BASE_IMAGE=${{ github.event.inputs.baseImage }}
BASE_TAG=${{ github.event.inputs.baseTag }}
47 changes: 14 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,19 @@
name: Manually Triggered Build and Push
# .github/workflows/release.yml
name: Release Workflow

on:
workflow_dispatch:
inputs:
baseImage:
description: 'Base image (e.g., nvcr.io/nvidia/tritonserver)'
required: true
default: 'nvcr.io/nvidia/tritonserver'
baseTag:
description: 'Base image tag (e.g., 24.01-py3-igpu)'
required: true
default: '24.01-py3-igpu'
push:
branches:
- main # Adjust this to match your release branch or triggering condition

jobs:
build-and-push:
trigger-builds:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/tritonserver-custom:${{ github.event.inputs.baseTag }}
build-args: |
BASE_IMAGE=${{ github.event.inputs.baseImage }}
BASE_TAG=${{ github.event.inputs.baseTag }}
strategy:
matrix:
baseImage: ['nvcr.io/nvidia/tritonserver']
baseTag: ['23.08']
uses: ./.github/workflows/build.yml
with:
baseImage: ${{ matrix.baseImage }}
baseTag: ${{ matrix.Tag}}

0 comments on commit 07bccbe

Please sign in to comment.