Sparsify v1.6.0 #2
Workflow file for this run
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 and Publish Sparsify Release Docker Images | |
on: | |
release: | |
types: [published] | |
jobs: | |
build-and-push-docker-image: | |
name: Build and Push Version Tagged Docker Images to GitHub Container Registry | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Cleanup disk | |
run: | | |
sudo ls -l /usr/local/lib/ | |
sudo ls -l /usr/share/ | |
sudo du -sh /usr/local/lib/ | |
sudo du -sh /usr/share/ | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /usr/share/dotnet | |
sudo du -sh /usr/local/lib/ | |
sudo du -sh /usr/share/ | |
- name: Set up Docker Buildx | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
buildkitd-flags: --debug | |
- name: Login to Github Packages | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout code | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Get Tag | |
id: extract_tag | |
run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF_NAME#*/})" | |
- name: Current Version Name | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
run: | | |
echo ${{ steps.extract_tag.outputs.tag }} | |
- name: Build and push sparsify release ${{ steps.extract_tag.outputs.tag }} docker image | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./docker | |
build-args: | | |
REF=release/${{ steps.extract_tag.outputs.tag }} | |
push: true | |
tags: | | |
ghcr.io/neuralmagic/sparsify:${{ steps.extract_tag.outputs.tag }} | |
- name: Image digest | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
run: echo ${{ steps.docker_build.outputs.digest }} |