mirror of
https://github.com/zama-ai/concrete.git
synced 2026-01-14 23:38:10 -05:00
45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
name: Concrete Python Push Docker Image
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: 'tag to use for the docker image'
|
|
type: string
|
|
workflow_call:
|
|
inputs:
|
|
tag:
|
|
description: 'tag to use for the docker image'
|
|
type: string
|
|
|
|
env:
|
|
DOCKER_IMAGE_NAME: zamafhe/concrete-python
|
|
DOCKER_FILE: docker/Dockerfile.concrete-python
|
|
|
|
jobs:
|
|
build_and_push:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
|
|
- name: Get version from tag
|
|
run: |
|
|
# remove leading 'v' and '-' from tag
|
|
export VERSION=`echo ${{ inputs.tag }} | sed "s/^v*//g" | sed "s/-//g"`
|
|
echo "VERSION=$VERSION" >> "${GITHUB_ENV}"
|
|
echo "NAME_TAG=${{ env.DOCKER_IMAGE_NAME }}:v$VERSION" >> "${GITHUB_ENV}"
|
|
|
|
- name: Build image
|
|
run: |
|
|
mkdir empty_context
|
|
docker image build -t ${{ env.NAME_TAG }} --build-arg version=${{ env.VERSION }} -f ${{ env.DOCKER_FILE }} empty_context
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Push image
|
|
run: docker image push ${{ env.NAME_TAG }}
|