diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6de33a251..06ba18e95 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -31,9 +31,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Set output - id: vars - run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/predibase/lorax + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=sha,prefix=,suffix=,format=short + type=raw,value=latest - name: Log in to GitHub Container Registry uses: docker/login-action@v1 @@ -48,6 +56,5 @@ jobs: context: . file: ./Dockerfile # Path to your Dockerfile push: true - tags: | - ghcr.io/predibase/lorax:${{ steps.vars.outputs.sha_short }} - ghcr.io/predibase/lorax:latest + tags: ${{ steps.meta.outputs.tags }} +