Skip to content

Commit

Permalink
feat: Add image build action
Browse files Browse the repository at this point in the history
  • Loading branch information
kackyt committed Aug 30, 2021
1 parent 92b823d commit f117097
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/push_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Push Image to DockerHub
on:
release:
types:
- published
workflow_dispatch:
inputs:
version:
description: 'MLFlow version'
required: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: checkout
uses: actions/checkout@v2
- name: set version number
id: set-version
run: |
echo "::set-output name=version::$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")"
- name: Build, tag, and push image to DockerHub
env:
DOCKER_REGISTRY: adacotechjp
DOCKER_REPOSITORY: mlflow
IMAGE_TAG: ${{ github.event.inputs.version || steps.set-version.outputs.version }}
run: |
docker build --build-arg mlflow_version=$IMAGE_TAG -t $DOCKER_REGISTRY/$DOCKER_REPOSITORY:$IMAGE_TAG .
docker push $DOCKER_REGISTRY/$DOCKER_REPOSITORY:$IMAGE_TAG
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ ARG mlflow_version
# poetry install
WORKDIR ${APP_PATH}
COPY . ${APP_PATH}
RUN apt update
RUN apt install -y --no-install-recommends wget git \
RUN apt update \
&& apt install -y --no-install-recommends wget git \
build-essential libffi-dev libssl-dev \
zlib1g-dev liblzma-dev libbz2-dev libreadline-dev \
libsqlite3-dev ca-certificates \
Expand Down

0 comments on commit f117097

Please sign in to comment.