Skip to content

Commit 6fc528e

Browse files
committed
Also publish for the version a tag
1 parent be07a80 commit 6fc528e

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/publish.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,30 @@ jobs:
7373
url: https://hub.docker.com/r/botsudo/capistrano
7474
runs-on: ubuntu-latest
7575
needs: build-image
76-
name: Create the image manifest
76+
name: Create the image manifest (${{ matrix.docker-hub-tag }})
77+
strategy:
78+
fail-fast: false
79+
matrix:
80+
include:
81+
- { docker-hub-tag: "tag-name" }
82+
- { docker-hub-tag: "build-version" }
83+
#- { docker-hub-tag: "build-version-tag-name" }
7784
steps:
85+
- name: Checkout repository
86+
uses: actions/checkout@v4
87+
- name: Get the version
88+
run: echo "BUILD_VERSION=$(make version)" >> $GITHUB_ENV
7889
- name: Login to DockerHub
7990
uses: docker/login-action@v3
8091
with:
8192
registry: docker.io
8293
username: ${{ secrets.DOCKER_REPOSITORY_LOGIN }}
8394
password: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }}
95+
- name: Get the version
96+
run: echo "IMAGE_TAG=$(echo '${{ matrix.docker-hub-tag }}' | sed 's/build-version/${{ env.BUILD_VERSION }}/' | sed 's/tag-name/${{ env.IMAGE_TAG_NAME }}/' )" >> $GITHUB_ENV
8497
- name: Create the manifest
8598
run: |
86-
docker manifest create ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_NAME }} \
99+
docker manifest create ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} \
87100
${{ env.IMAGE_NAME }}:arm64-${{ env.IMAGE_TAG_NAME }} \
88101
${{ env.IMAGE_NAME }}:amd64-${{ env.IMAGE_TAG_NAME }} \
89102
${{ env.IMAGE_NAME }}:armv7-${{ env.IMAGE_TAG_NAME }} \
@@ -94,9 +107,9 @@ jobs:
94107
${{ env.IMAGE_NAME }}:386-${{ env.IMAGE_TAG_NAME }} \
95108
--amend
96109
- name: Push the manifest
97-
run: docker manifest push ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_NAME }}
110+
run: docker manifest push ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
98111
- name: Inspect the manifest
99-
run: docker manifest inspect ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_NAME }}
112+
run: docker manifest inspect ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
100113

101114
tags-cleanup:
102115
environment:

0 commit comments

Comments
 (0)