File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CD
2+ on :
3+ push :
4+ branches :
5+ - " main"
6+ tags :
7+ - " v*"
8+ release :
9+ types :
10+ - published
11+ concurrency :
12+ # Only run the latest workflow.
13+ # If a build is already happening, cancel it to avoid a race
14+ # condition where an older image overwrites a newer one.
15+ group : ${{ github.workflow }}
16+ cancel-in-progress : true
17+ jobs :
18+ build :
19+ name : Build [batai]
20+ runs-on : ubuntu-latest
21+ strategy :
22+ matrix :
23+ image : [server, client]
24+ steps :
25+ - name : Checkout repository
26+ uses : actions/checkout@v4
27+ - name : Set up Docker Buildx
28+ uses : docker/setup-buildx-action@v3
29+ - name : Login to GHCR
30+ uses : docker/login-action@v3
31+ with :
32+ registry : ghcr.io
33+ username : ${{ github.repository_owner }}
34+ password : ${{ secrets.GITHUB_TOKEN }}
35+ - name : Generate image tags
36+ uses : docker/metadata-action@v5
37+ id : image-tags
38+ with :
39+ images :
40+ ghcr.io/Kitware/batai/${{ matrix.image }}
41+ tags : |
42+ type=ref,event=branch
43+ type=semver,pattern={{version}}
44+ - name : Build and push Docker image
45+ uses : docker/build-push-action@v5
46+ with :
47+ cache-from : type=gha
48+ cache-to : type=gha,mode=max
49+ file : ${{ matrix.image == 'server' && 'dev/django.Dockerfile' || 'dev/client.Dockerfile' }}
50+ context : .
51+ platforms : linux/amd64
52+ push : true
53+ tags : ${{ steps.image-tags.outputs.result }}
Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ services:
3939 - " 443:443"
4040
4141 django :
42+ # Specifying both image and build without pull_policy will default to
43+ # attempting to pull the image first, then build from source if that fails.
44+ image : ghcr.io/Kitware/batai/server:latest
4245 build :
4346 context : .
4447 dockerfile : ./dev/django.Dockerfile
@@ -85,6 +88,9 @@ services:
8588 - rabbitmq
8689 - minio
8790 client :
91+ # Specifying both image and build without pull_policy will default to
92+ # attempting to pull the image first, then build from source if that fails.
93+ image : ghcr.io/Kitware/batai/client:latest
8894 build :
8995 context : .
9096 dockerfile : ./dev/client.Dockerfile
You can’t perform that action at this time.
0 commit comments