Skip to content

Build Context Builder Image #408

Build Context Builder Image

Build Context Builder Image #408

name: Build Context Builder Image
on:
workflow_dispatch:
jobs:
detect-version:
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.versions.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
# We need to use a different github token because GITHUB_TOKEN cannot trigger a workflow from another
token: ${{secrets.BASETENBOT_GITHUB_TOKEN}}
fetch-depth: 2
- run: curl -sSL https://install.python-poetry.org | python3 -
shell: bash
- id: versions
run: |
VERSION=$(poetry version | awk '{print $2}')
echo "version=$VERSION" >> $GITHUB_OUTPUT
build-n-push-context-builder-image:
runs-on: ubuntu-20.04
needs: [detect-version]
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: baseten/truss-context-builder
- name: Docker Build
id: docker_build
uses: docker/build-push-action@v5
with:
context: ./
file: ./context_builder.Dockerfile
push: true
tags: baseten/truss-context-builder:v${{ needs.detect-version.outputs.version }}
labels: ${{ steps.meta.outputs.labels }}