Skip to content

Commit 9855898

Browse files
committed
fix ci for building tags
1 parent 69a41d9 commit 9855898

File tree

2 files changed

+54
-7
lines changed

2 files changed

+54
-7
lines changed

.github/workflows/docker-image-hyperspace.yml

+24-5
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,23 @@ jobs:
4848
- name: Set up Docker Buildx
4949
uses: docker/setup-buildx-action@v3
5050

51-
- name: Extract metadata (tags, labels) for Docker
52-
id: meta
51+
- name: Extract metadata (tags, labels) for Docker (tag)
52+
id: meta-tag
53+
if: github.ref_type == 'tag'
5354
uses: docker/metadata-action@v5
5455
with:
5556
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
5657
tags: |
5758
type=semver,pattern={{version}}
5859
type=semver,pattern={{major}}.{{minor}}
60+
61+
- name: Extract metadata (tags, labels) for Docker (branch)
62+
id: meta-branch
63+
if: github.ref_type == 'branch'
64+
uses: docker/metadata-action@v5
65+
with:
66+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
67+
tags: |
5968
type=ref,event=branch
6069
type=sha,prefix={{branch}}-
6170
@@ -66,10 +75,20 @@ jobs:
6675
username: ${{ github.repository_owner }}
6776
password: ${{ secrets.GITHUB_TOKEN }}
6877

69-
- name: Build and push Docker image
78+
- name: Build and push Docker image (tag)
79+
if: github.ref_type == 'tag'
80+
uses: docker/build-push-action@v5
81+
with:
82+
file: scripts/hyperspace.Dockerfile
83+
push: ${{ github.event_name != 'pull_request' }}
84+
tags: ${{ steps.meta-tag.outputs.tags }}
85+
labels: ${{ steps.meta-tag.outputs.labels }}
86+
87+
- name: Build and push Docker image (branch)
88+
if: github.ref_type == 'branch'
7089
uses: docker/build-push-action@v5
7190
with:
7291
file: scripts/hyperspace.Dockerfile
7392
push: ${{ github.event_name != 'pull_request' }}
74-
tags: ${{ steps.meta.outputs.tags }}
75-
labels: ${{ steps.meta.outputs.labels }}
93+
tags: ${{ steps.meta-branch.outputs.tags }}
94+
labels: ${{ steps.meta-branch.outputs.labels }}

.github/workflows/docker-image-indexer.yml

+30-2
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,23 @@ jobs:
4848
- name: Set up Docker Buildx
4949
uses: docker/setup-buildx-action@v3
5050

51-
- name: Extract metadata (tags, labels) for Docker
52-
id: meta
51+
- name: Extract metadata (tags, labels) for Docker (tag)
52+
id: meta-tag
53+
if: github.ref_type == 'tag'
5354
uses: docker/metadata-action@v5
5455
with:
5556
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
5657
tags: |
5758
type=semver,pattern={{version}}
5859
type=semver,pattern={{major}}.{{minor}}
60+
61+
- name: Extract metadata (tags, labels) for Docker (branch)
62+
id: meta-branch
63+
if: github.ref_type == 'branch'
64+
uses: docker/metadata-action@v5
65+
with:
66+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
67+
tags: |
5968
type=ref,event=branch
6069
type=sha,prefix={{branch}}-
6170
@@ -73,3 +82,22 @@ jobs:
7382
push: ${{ github.event_name != 'pull_request' }}
7483
tags: ${{ steps.meta.outputs.tags }}
7584
labels: ${{ steps.meta.outputs.labels }}
85+
86+
87+
- name: Build and push Docker image (tag)
88+
if: github.ref_type == 'tag'
89+
uses: docker/build-push-action@v5
90+
with:
91+
file: scripts/indexer.Dockerfile
92+
push: ${{ github.event_name != 'pull_request' }}
93+
tags: ${{ steps.meta-tag.outputs.tags }}
94+
labels: ${{ steps.meta-tag.outputs.labels }}
95+
96+
- name: Build and push Docker image (branch)
97+
if: github.ref_type == 'branch'
98+
uses: docker/build-push-action@v5
99+
with:
100+
file: scripts/indexer.Dockerfile
101+
push: ${{ github.event_name != 'pull_request' }}
102+
tags: ${{ steps.meta-branch.outputs.tags }}
103+
labels: ${{ steps.meta-branch.outputs.labels }}

0 commit comments

Comments
 (0)