From 3f8d4be921ee12165b4feb867265df73d79ef78a Mon Sep 17 00:00:00 2001 From: Pauline Bailly-Masson <155966238+paulinebm@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:18:11 +0200 Subject: [PATCH] Create tpu-tgi-release.yaml --- .github/workflows/tpu-tgi-release.yaml | 66 ++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/tpu-tgi-release.yaml diff --git a/.github/workflows/tpu-tgi-release.yaml b/.github/workflows/tpu-tgi-release.yaml new file mode 100644 index 00000000..fee8ff1d --- /dev/null +++ b/.github/workflows/tpu-tgi-release.yaml @@ -0,0 +1,66 @@ +name: Release + +on: + workflow_dispatch: + release: + types: [published] +jobs: + docker: + name: Push TGI Docker container to Docker Hub and Github Registry + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + attestations: write + id-token: write + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: echo "${{ env.REGISTRY }}" + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }} + flavor: | + latest=auto + prefix= + suffix=-tgi + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v6 + with: + context: . + file: text-generation-inference/docker/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build_args: | + VERSION=${{ github.event.release.tag_name }} + TGI_VERSION=5bc3d65dd32ba1f979540caeccbf3dd8798dd9df + target: inference-endpoint + + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true