Merge branch 'HumanSignal:master' into master #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Docker build & push" | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- deploy/** | |
- label_studio/** | |
- setup.py | |
- .github/workflows/docker-build.yml | |
tags: [ '*' ] | |
env: | |
DOCKER_CLI_EXPERIMENTAL: enabled | |
IMAGE_NAME: heartexlabs/label-studio | |
DOCKER_TAG: 'latest' | |
jobs: | |
docker_build_and_push: | |
name: "Docker build and push" | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Override image tag on 'tag' | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
echo "DOCKER_TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Login to DockerHub | |
uses: docker/[email protected] | |
with: | |
username: heartexlabs | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.8' | |
- name: Create version_.py | |
run: | | |
python3 $(pwd)/label_studio/core/version.py | |
cat $(pwd)/label_studio/core/version_.py | |
- name: Build and push | |
uses: docker/[email protected] | |
id: docker_build_and_push | |
with: | |
context: . | |
push: true | |
tags: ${{ env.IMAGE_NAME }}:${{ env.DOCKER_TAG }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |