mirror of
https://github.com/zama-ai/concrete.git
synced 2026-01-09 12:57:55 -05:00
feat(ci): push concrete-python docker image on release
This commit is contained in:
43
.github/workflows/concrete_python_push_docker_image.yml
vendored
Normal file
43
.github/workflows/concrete_python_push_docker_image.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
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:${{ inputs.tag }}
|
||||
DOCKER_FILE: docker/Dockerfile.concrete-python
|
||||
|
||||
jobs:
|
||||
build_and_push:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- 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}"
|
||||
|
||||
- name: Build image
|
||||
run: |
|
||||
mkdir empty_context
|
||||
docker image build -t ${{ env.DOCKER_IMAGE_NAME }} --build-arg version=${{ env.VERSION }} -f ${{ env.DOCKER_FILE }} empty_context
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Push image
|
||||
run: docker image push ${{ env.DOCKER_IMAGE_NAME }}
|
||||
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
@@ -271,3 +271,11 @@ jobs:
|
||||
with:
|
||||
command: concrete-python-release
|
||||
user_inputs: 'public'
|
||||
|
||||
concrete-python-docker-release:
|
||||
needs: [concrete-python-public-release]
|
||||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
uses: ./.github/workflows/concrete_python_push_docker_image.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
tag: ${{ github.ref_name }}
|
||||
|
||||
5
docker/Dockerfile.concrete-python
Normal file
5
docker/Dockerfile.concrete-python
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM python:3.10-slim
|
||||
|
||||
ARG version
|
||||
|
||||
RUN pip install concrete-python==${version}
|
||||
Reference in New Issue
Block a user