Skip to content

Commit 024975c

Browse files
authored
Merge branch 'dev' into vh-gene-index-to-target-index
2 parents 3582b34 + 111d902 commit 024975c

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

.github/workflows/artifact.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ name: Build and Push to Artifact Registry
22

33
"on":
44
push:
5-
branches: ["*"]
6-
tags: ["*"]
5+
branches:
6+
- "*"
7+
tags:
8+
- "v[0-9]+.[0-9]+.[0-9]+-*"
79

810
env:
911
PROJECT_ID: open-targets-genetics-dev
@@ -37,7 +39,7 @@ jobs:
3739
uses: docker/setup-buildx-action@v3
3840

3941
- name: "Docker auth"
40-
run: |-
42+
run: |
4143
gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet
4244
4345
- name: Quick Docker build (gentropy only, AMD64 only, with layer cache)
@@ -50,22 +52,33 @@ jobs:
5052
cache-from: type=gha
5153
cache-to: type=gha,mode=max
5254

55+
# skip the `v` at the beginning of the tag for docker image tags
56+
- name: Create a docker tag
57+
id: docker-tag
58+
shell: bash
59+
env:
60+
TAG: ${{ github.ref_name }}
61+
run: |
62+
TAG=$(echo $TAG | sed 's/^v//')
63+
echo "TAG=$TAG" >> $GITHUB_ENV
64+
echo "The tag for this build is $TAG"
65+
5366
- name: Build and push gentropy image
54-
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/v')
67+
if: steps.docker-tag.outcome == 'success'
5568
uses: docker/build-push-action@v6
5669
with:
5770
platforms: linux/amd64,linux/arm64
5871
push: true
59-
tags: "${{ env.GAR_LOCATION }}/${{ env.REPOSITORY }}/gentropy:${{ github.ref_name }}"
72+
tags: "${{ env.GAR_LOCATION }}/${{ env.REPOSITORY }}/gentropy:${{ env.TAG }}"
6073
context: .
6174

6275
- name: Build and push VEP image
63-
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/v')
76+
if: steps.docker-tag.outcome == 'success'
6477
uses: docker/build-push-action@v6
6578
with:
6679
platforms: linux/amd64
6780
push: true
68-
tags: "${{ env.GAR_LOCATION }}/${{ env.REPOSITORY }}/custom_ensembl_vep:${{ github.ref_name }}"
81+
tags: "${{ env.GAR_LOCATION }}/${{ env.REPOSITORY }}/custom_ensembl_vep:${{ env.TAG }}"
6982
context: .
7083
file: "src/vep/Dockerfile"
7184

0 commit comments

Comments
 (0)