forked from HumanSignal/label-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 1.46 KB
/
docker-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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