Spaces:
No application file
No application file
Upload .github\workflows\docker-build.yml with huggingface_hub
Browse files
.github//workflows//docker-build.yml
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Build docker image
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
pull_request:
|
| 5 |
+
branches:
|
| 6 |
+
- "main"
|
| 7 |
+
paths:
|
| 8 |
+
- api/Dockerfile
|
| 9 |
+
- web/Dockerfile
|
| 10 |
+
|
| 11 |
+
concurrency:
|
| 12 |
+
group: docker-build-${{ github.head_ref || github.run_id }}
|
| 13 |
+
cancel-in-progress: true
|
| 14 |
+
|
| 15 |
+
jobs:
|
| 16 |
+
build-docker:
|
| 17 |
+
runs-on: ubuntu-latest
|
| 18 |
+
strategy:
|
| 19 |
+
matrix:
|
| 20 |
+
include:
|
| 21 |
+
- service_name: "api-amd64"
|
| 22 |
+
platform: linux/amd64
|
| 23 |
+
context: "api"
|
| 24 |
+
- service_name: "api-arm64"
|
| 25 |
+
platform: linux/arm64
|
| 26 |
+
context: "api"
|
| 27 |
+
- service_name: "web-amd64"
|
| 28 |
+
platform: linux/amd64
|
| 29 |
+
context: "web"
|
| 30 |
+
- service_name: "web-arm64"
|
| 31 |
+
platform: linux/arm64
|
| 32 |
+
context: "web"
|
| 33 |
+
steps:
|
| 34 |
+
- name: Set up QEMU
|
| 35 |
+
uses: docker/setup-qemu-action@v3
|
| 36 |
+
|
| 37 |
+
- name: Set up Docker Buildx
|
| 38 |
+
uses: docker/setup-buildx-action@v3
|
| 39 |
+
|
| 40 |
+
- name: Build Docker Image
|
| 41 |
+
uses: docker/build-push-action@v6
|
| 42 |
+
with:
|
| 43 |
+
push: false
|
| 44 |
+
context: "{{defaultContext}}:${{ matrix.context }}"
|
| 45 |
+
platforms: ${{ matrix.platform }}
|
| 46 |
+
cache-from: type=gha
|
| 47 |
+
cache-to: type=gha,mode=max
|