@@ -3,16 +3,27 @@ name: "Build and publish Hyperspace Docker image"
33on :
44 push :
55 branches :
6- - master
6+ - ' *'
7+ tags :
8+ - ' v*'
9+
10+ env :
11+ IMAGE_NAME : ${{ github.repository }}
712
813jobs :
14+
915 build-and-publish :
16+
17+ name : Build & push docker image
18+
1019 runs-on :
1120 - self-hosted
1221 - x64-monster
22+
1323 concurrency :
1424 group : hyperspace-docker-image-${{ github.ref }}
1525 cancel-in-progress : true
26+
1627 strategy :
1728 fail-fast : true
1829
@@ -31,14 +42,33 @@ jobs:
3142 with :
3243 fetch-depth : 0
3344
45+ - name : Set up QEMU
46+ uses : docker/setup-qemu-action@v3
47+
48+ - name : Set up Docker Buildx
49+ uses : docker/setup-buildx-action@v3
50+
51+ - name : Extract metadata (tags, labels) for Docker
52+ id : meta
53+ uses : docker/metadata-action@v5
54+ with :
55+ images : ${{ env.IMAGE_NAME }}
56+ tags : |
57+ type=semver,pattern={{version}}
58+ type=semver,pattern={{major}}.{{minor}}
59+ type=ref,event=branch
60+ type=sha,prefix={{branch}}-
61+
3462 - name : Login to Docker Hub
3563 uses : docker/login-action@v2
3664 with :
3765 username : ${{ secrets.DOCKER_HUB_USERNAME }}
3866 password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
3967
40- - name : Build Docker image
41- run : make -f hyperspace/Makefile build-docker-image-hyperspace
42-
43- - name : Docker push
44- run : make -f hyperspace/Makefile publish-docker-image-hyperspace
68+ - name : Build and push Docker image
69+ uses : docker/build-push-action@v5
70+ with :
71+ file : scripts/hyperspace.Dockerfile
72+ push : ${{ github.event_name != 'pull_request' }}
73+ tags : ${{ steps.meta.outputs.tags }}
74+ labels : ${{ steps.meta.outputs.labels }}
0 commit comments