Skip to content

Commit 85a89b5

Browse files
committed
GitHub: split git tag and image tag
This commit allows us to have different values for the git tag that is checked out (RELEASE_VERSION) and the image tag that we push (IMAGE_TAG).
1 parent cf9aaf3 commit 85a89b5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/docker.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,20 @@ jobs:
3030
username: ${{ secrets.DOCKER_USERNAME }}
3131
password: ${{ secrets.DOCKER_API_KEY }}
3232

33+
# Make it possible to use different values for the version (used for git
34+
# checkout) and the image tag (used for the docker image tag).
3335
- name: Set env
34-
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
36+
run: |
37+
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
38+
echo "IMAGE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
3539
3640
- name: Build and push default image
3741
id: docker_build
3842
uses: lightninglabs/gh-actions/[email protected]
3943
with:
4044
push: true
4145
platforms: linux/amd64,linux/arm64
42-
tags: "${{ env.DOCKER_ORG }}/${{ env.DOCKER_REPO }}:${{ env.RELEASE_VERSION }}"
46+
tags: "${{ env.DOCKER_ORG }}/${{ env.DOCKER_REPO }}:${{ env.IMAGE_TAG }}"
4347
build-args: checkout=${{ env.RELEASE_VERSION }}
4448

4549
- name: Build and push image with /lit path
@@ -48,7 +52,7 @@ jobs:
4852
with:
4953
push: true
5054
platforms: linux/amd64,linux/arm64
51-
tags: "${{ env.DOCKER_ORG }}/${{ env.DOCKER_REPO }}:${{ env.RELEASE_VERSION }}-path-prefix"
55+
tags: "${{ env.DOCKER_ORG }}/${{ env.DOCKER_REPO }}:${{ env.IMAGE_TAG }}-path-prefix"
5256
build-args: |
5357
checkout=${{ env.RELEASE_VERSION }}
5458
public_url=/lit

0 commit comments

Comments
 (0)