update to add steps to publish nightly wheel and create nightly docke… #207
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Container with wheel and push to GCR | ||
on: | ||
workflow_call: | ||
inputs: | ||
build-label: | ||
description: "requested runner label" | ||
type: string | ||
dev: | ||
type: string | ||
required: true | ||
release: | ||
type: string | ||
required: true | ||
name: | ||
type: string | ||
jobs: | ||
build-container: | ||
runs-on: ${{ inputs.build-label }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
buildkitd-flags: --debug | ||
- name: Get current date | ||
id: date | ||
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | ||
- name: Get the current version | ||
if: ${{ inputs.release == 'true' }} | ||
id: version | ||
run: echo "version=$(echo ${{ github.base_ref }} | cut -c 9-15)" >> $GITHUB_OUTPUT | ||
- name: Login to Github Packages | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build Dev Docker Container | ||
if: ${{ inputs.dev == 'true' }} | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ./docker/containers/docker_dev | ||
build-args: | | ||
BRANCH=${{github.head_ref}} | ||
push: true | ||
tags: ghcr.io/neuralmagic/sparseml-dev:${{ inputs.name }} | ||
- name: Build Nightly Docker Container | ||
if: ${{ inputs.DEV == 'false' && inputs.RELEASE == 'false'}} | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ./docker/containers/docker_nightly | ||
push: true | ||
tags: ghcr.io/neuralmagic/sparseml-nightly:latest, ghcr.io/neuralmagic/sparseml-nightly:${{ steps.date.outputs.date }} |