Skip to content

Commit 2b5914f

Browse files
committed
Fix for failing to check out the latest tag
1 parent 7956bc2 commit 2b5914f

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

.github/workflows/build-push-apptainer.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,29 @@ jobs:
2121
- name: Check out the repository
2222
uses: actions/checkout@v4
2323
with:
24-
fetch-depth: 0 # Ensure all tags are fetched
24+
fetch-depth: 0 # Fetch full history including all tags
25+
26+
- name: Fetch all tags
27+
run: git fetch --tags # Ensure all tags are available
2528

2629
- name: Get the latest tag
2730
id: get-latest-tag
2831
run: echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
2932

30-
- name: Check out the latest tag
31-
uses: actions/checkout@v4
33+
- name: Log in to Docker Hub
34+
uses: docker/login-action@v3
35+
with:
36+
username: ${{ secrets.DOCKER_USERNAME }}
37+
password: ${{ secrets.DOCKER_PASSWORD }}
38+
39+
- name: Extract metadata (tags, labels) for Docker
40+
id: meta
41+
uses: docker/metadata-action@v5
3242
with:
33-
ref: ${{ env.LATEST_TAG }}
34-
fetch-depth: 0
43+
images: marcelzwiers/bidscoin
44+
tags: |
45+
type=semver,pattern=${{ env.LATEST_TAG }}
46+
type=raw,value=latest
3547
3648
- name: Build SIF image
3749
run: |

.github/workflows/build-push-docker.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,15 @@ jobs:
1818
- name: Check out the repository
1919
uses: actions/checkout@v4
2020
with:
21-
fetch-depth: 0 # Ensure all tags are fetched
21+
fetch-depth: 0 # Fetch full history including all tags
22+
23+
- name: Fetch all tags
24+
run: git fetch --tags # Ensure all tags are available
2225

2326
- name: Get the latest tag
2427
id: get-latest-tag
2528
run: echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
2629

27-
- name: Check out the latest tag
28-
uses: actions/checkout@v4
29-
with:
30-
ref: ${{ env.LATEST_TAG }}
31-
fetch-depth: 0
32-
3330
- name: Log in to Docker Hub
3431
uses: docker/login-action@v3
3532
with:
@@ -42,7 +39,7 @@ jobs:
4239
with:
4340
images: marcelzwiers/bidscoin
4441
tags: |
45-
type=semver,pattern={{version}}
42+
type=semver,pattern=${{ env.LATEST_TAG }}
4643
type=raw,value=latest
4744
4845
- name: Build and push Docker image

0 commit comments

Comments
 (0)