From 07d7d4fa2d12ea8c7cf2b34b50a437f9d5a58086 Mon Sep 17 00:00:00 2001 From: Rahul Tuli Date: Thu, 21 Sep 2023 09:00:30 -0400 Subject: [PATCH] Workflow to push nightly docker images (#1684) --- .../publish-nightly-docker-images.yaml | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/publish-nightly-docker-images.yaml diff --git a/.github/workflows/publish-nightly-docker-images.yaml b/.github/workflows/publish-nightly-docker-images.yaml new file mode 100644 index 00000000000..5ca14ac08bc --- /dev/null +++ b/.github/workflows/publish-nightly-docker-images.yaml @@ -0,0 +1,79 @@ +name: Publish Nightly Docker Images + +on: + push: + branches: + - 'main' + schedule: + - cron: '0 1 * * *' + workflow_dispatch: +jobs: + push-nightly-docker-image: + name: Push Version Tagged Nightly Docker Images + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + with: + buildkitd-flags: --debug + + - name: Login to Github Packages + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Get version tag + id: extract_tag + run: echo "tag=$(date +%Y%m%d)" >> $GITHUB_OUTPUT + + - name: Current Version Name + run: | + echo ${{ steps.extract_tag.outputs.tag }} + + - name: Sparseml-Nightly latest using default cuda 11.1.1 + uses: docker/build-push-action@v2 + with: + context: ./docker + build-args: | + DEPS=all + BRANCH=main + push: true + tags: | + ghcr.io/neuralmagic/sparseml-nightly:latest + + - name: Today's Sparseml-Nightly using default cuda 11.1.1 + uses: docker/build-push-action@v2 + with: + context: ./docker + build-args: | + DEPS=all + BRANCH=main + push: true + tags: | + ghcr.io/neuralmagic/sparseml-nightly:${{ steps.extract_tag.outputs.tag }} + + - name: Today's Sparseml-Nightly Base using default cuda 11.1.1 + uses: docker/build-push-action@v2 + with: + context: ./docker + build-args: | + DEPS=base + BRANCH=main + push: true + tags: | + ghcr.io/neuralmagic/sparseml-nightly:base-${{ steps.extract_tag.outputs.tag }} + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }}